joyent/node-triton#7 "triton create" could better handle missing package argument

This commit is contained in:
Trent Mick 2015-09-03 10:18:35 -07:00
parent 804fe155b9
commit 19ede6e489

View File

@ -18,9 +18,8 @@ function do_create_instance(subcmd, opts, args, callback) {
if (opts.help) { if (opts.help) {
this.do_help('help', {}, [subcmd], callback); this.do_help('help', {}, [subcmd], callback);
return; return;
} else if (args.length < 1 || args.length > 2) { } else if (args.length !== 2) {
return callback(new errors.UsageError(format( return callback(new errors.UsageError('incorrect number of args'));
'incorrect number of args (%d)', args.length)));
} }
var log = this.triton.log; var log = this.triton.log;
@ -206,7 +205,7 @@ do_create_instance.help = (
'Create a new instance.\n' + 'Create a new instance.\n' +
'\n' + '\n' +
'Usage:\n' + 'Usage:\n' +
' {{name}} create-instance [<options>] IMAGE [PACKAGE]\n' + ' {{name}} create-instance [<options>] IMAGE PACKAGE\n' +
'\n' + '\n' +
'{{options}}' '{{options}}'
/* END JSSTYLED */ /* END JSSTYLED */