Better help output for 'triton keys', also avoid double newlines between key output.

This commit is contained in:
Trent Mick 2015-11-05 12:41:56 -08:00
parent c7daecc6f3
commit 4491a55093
1 changed files with 10 additions and 4 deletions

View File

@ -30,9 +30,11 @@ function do_keys(subcmd, opts, args, callback) {
if (opts.json) {
common.jsonStream(keys);
} else {
// pretty print
keys.forEach(function (key) {
console.log(key.key);
process.stdout.write(key.key);
if (key.key && key.key.slice(-1) !== '\n') {
process.stdout.write('\n');
}
});
}
callback();
@ -52,12 +54,16 @@ do_keys.options = [
}
];
do_keys.help = (
'Show account keys.\n'
'Show account SSH keys.\n'
+ '\n'
+ 'Usage:\n'
+ ' {{name}} keys\n'
+ ' {{name}} keys [<options>]\n'
+ '\n'
+ '{{options}}'
+ '\n'
+ 'By default this lists just the key content for each key -- in other\n'
+ 'words, content appropriate for a "~/.ssh/authorized_keys" file.\n'
+ 'Use `triton keys -j` to see all fields.\n'
);
module.exports = do_keys;