Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cleanup how the cli is invoked a bit

  • Loading branch information...
commit 6d1b304de8c5c3f39abdb0ed872d84a926ccefb4 1 parent 2ebf1d5
@isao isao authored
Showing with 6 additions and 10 deletions.
  1. +3 −5 bin/mojito
  2. +3 −5 lib/management/cli.js
View
8 bin/mojito
@@ -4,9 +4,7 @@
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
-var cli,
- resolve = require('path').resolve,
- mojito = require(resolve(__dirname, '../lib/mojito'));
+var resolve = require('path').resolve;
+ cli = require(resolve(__dirname, '../lib/management/cli'));
-cli = mojito.include('management/cli');
-cli.run();
+cli.run(process.argv.slice(2));
View
8 lib/management/cli.js
@@ -140,9 +140,8 @@
* the command module's run method will be invoked. The command module's
* exported options are used to assist in parsing the command line.
*/
- CLI.run = function() {
- var args = process.argv.slice(2),
- commandName = (args.length === 0 ? 'help' : args.shift()),
+ CLI.run = function(args) {
+ var commandName = args.shift() || 'help',
command,
argInfo;
@@ -150,8 +149,7 @@
command = require('mojito-cli-cmd-' + commandName);
} catch (e) {
try {
- command = require(libpath.join(__dirname, '../app/commands/',
- commandName));
+ command = require(libpath.join('../app/commands/', commandName));
} catch (e2) {
utils.error('Error loading command: ' + command + ' ' + e2.message,
'mojito <command> [<params>] [<options>]');
Please sign in to comment.
Something went wrong with that request. Please try again.