Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
listkeys and describe do proper argument error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
lloyd committed Sep 25, 2013
1 parent d39033f commit 1668c2a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions awsbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,11 @@ verbs.update = function(args) {
};
verbs.update.doc = "git push to an instance";

verbs.describe = function(name) {
verbs.describe = function(args) {
if (!args || args.length !== 1) {
throw 'missing required argument: name of instance'.error;
}
var name = args[0];
validateName(name);
vm.describe(name, function(err, deets) {
if (err) fail(err);
Expand All @@ -679,7 +683,11 @@ verbs.describe = function(name) {
};
verbs.describe.doc = "get information about an instance (by instance id, or name)";

verbs.listkeys = function(name) {
verbs.listkeys = function(args) {
if (!args || args.length !== 1) {
throw 'missing required argument: name of instance'.error;
}
var name = args[0];
validateName(name);
vm.describe(name, function(err, deets) {
if (err) fail(err);
Expand Down

0 comments on commit 1668c2a

Please sign in to comment.