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) {
|
if (opts.json) {
|
||||||
common.jsonStream(keys);
|
common.jsonStream(keys);
|
||||||
} else {
|
} else {
|
||||||
// pretty print
|
|
||||||
keys.forEach(function (key) {
|
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();
|
callback();
|
||||||
@ -52,12 +54,16 @@ do_keys.options = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
do_keys.help = (
|
do_keys.help = (
|
||||||
'Show account keys.\n'
|
'Show account SSH keys.\n'
|
||||||
+ '\n'
|
+ '\n'
|
||||||
+ 'Usage:\n'
|
+ 'Usage:\n'
|
||||||
+ ' {{name}} keys\n'
|
+ ' {{name}} keys [<options>]\n'
|
||||||
+ '\n'
|
+ '\n'
|
||||||
+ '{{options}}'
|
+ '{{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;
|
module.exports = do_keys;
|
||||||
|
Reference in New Issue
Block a user