Skip to content

Commit

Permalink
Added cli usage display.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcantelon committed Apr 20, 2012
1 parent da76bbc commit 3808fae
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/keyserver/cli.js
Expand Up @@ -45,5 +45,10 @@ parser.addCommand('value')
return 'Value retrieved.'
})

client = new Client(parser)
client.set('port', 8888).start(argv)
// parse if valid, otherwise display usage
if (parser.validCommands(argv._).length > 0) {
client = new Client(parser)
client.set('port', 8888).start(argv)
} else {
console.log('Usage: set <key> <value> | get <key>');
}

0 comments on commit 3808fae

Please sign in to comment.