Better help output for 'triton keys', also avoid double newlines between key output.
This commit is contained in:
parent
c7daecc6f3
commit
4491a55093
@ -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;
|
||||
|
Reference in New Issue
Block a user