Skip to content

Commit

Permalink
Abort with hint when no command given.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlindley committed Sep 16, 2012
1 parent df86e9f commit ebc2e13
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bin/ey_node_app_info
@@ -1,7 +1,8 @@
#!/usr/bin/env node

var optparse = require('optparse'),
fs = require('fs');
fs = require('fs'),
nodeApp = null;

var switches = [
['--app PATH', 'The path to a Node.js application.'],
Expand Down Expand Up @@ -53,7 +54,15 @@ if(! parseResult ) {
commands = parseResult.slice(2);
}

var nodeApp = require('./../lib/node_app').createFrom(options);
var primaryCommand = commands[0];
var secondaryCommand = commands[1];

if (! primaryCommand) {
console.error("Incorrect usage. See `ey_node_app_info --help`");
process.exit(1);
} else {
nodeApp = require('./../lib/node_app').createFrom(options);
}

if(options.verbose) {
console.log(options, command);
Expand Down

0 comments on commit ebc2e13

Please sign in to comment.