From 19ede6e489d358e3bd6bd2e0edc8348d876a9ff8 Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Thu, 3 Sep 2015 10:18:35 -0700 Subject: [PATCH] joyent/node-triton#7 "triton create" could better handle missing package argument --- lib/do_create_instance.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/do_create_instance.js b/lib/do_create_instance.js index c06b6f3..8af49ba 100644 --- a/lib/do_create_instance.js +++ b/lib/do_create_instance.js @@ -18,9 +18,8 @@ function do_create_instance(subcmd, opts, args, callback) { if (opts.help) { this.do_help('help', {}, [subcmd], callback); return; - } else if (args.length < 1 || args.length > 2) { - return callback(new errors.UsageError(format( - 'incorrect number of args (%d)', args.length))); + } else if (args.length !== 2) { + return callback(new errors.UsageError('incorrect number of args')); } var log = this.triton.log; @@ -206,7 +205,7 @@ do_create_instance.help = ( 'Create a new instance.\n' + '\n' + 'Usage:\n' + - ' {{name}} create-instance [] IMAGE [PACKAGE]\n' + + ' {{name}} create-instance [] IMAGE PACKAGE\n' + '\n' + '{{options}}' /* END JSSTYLED */