From 4491a5509350957327c415a40af45efa87ee5f04 Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Thu, 5 Nov 2015 12:41:56 -0800 Subject: [PATCH] Better help output for 'triton keys', also avoid double newlines between key output. --- lib/do_keys.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/do_keys.js b/lib/do_keys.js index 22f85f7..b2efe7a 100644 --- a/lib/do_keys.js +++ b/lib/do_keys.js @@ -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 []\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;