Skip to content

Commit

Permalink
Removed logs, allow unknown arguments in 'generate' command.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikermcneil committed Jan 17, 2014
1 parent b6a7033 commit 6c22780
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 0 additions & 4 deletions bin/_commander.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@ function () {
program.emit('version');
};

// Don't balk at unknown options
program.unknownOption = function(){};


module.exports = program;
7 changes: 7 additions & 0 deletions bin/sails-generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = function () {
// Get CLI configuration
var config = rc('sails');


// Build initial scope
var scope = {
rootPath: process.cwd(),
Expand All @@ -35,6 +36,12 @@ module.exports = function () {
// Mix-in rc config
_.merge(scope, config.generators);

// TODO: just do a top-level merge and reference
// `scope.generators.modules` as needed (simpler)
_.merge(scope, config);

console.log(config);

var cliArguments = Array.prototype.slice.call(arguments);

// Remove commander's extra argument
Expand Down
10 changes: 8 additions & 2 deletions bin/sails.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
*/
var _ = require('lodash')
, program = require('./_commander')
, package = require('../package.json');
, package = require('../package.json')
, NOOP = function(){};



Expand Down Expand Up @@ -70,7 +71,9 @@ program


// $ sails generate <module>
program.command('generate')
var generate = program.command('generate');
generate.unknownOption = NOOP;
generate
.description('')
.option('--dry')
.action(require('./sails-generate'));
Expand Down Expand Up @@ -131,6 +134,9 @@ program



// Don't balk at unknown options
program.unknownOption = NOOP;



// $ sails
Expand Down

0 comments on commit 6c22780

Please sign in to comment.