From 2409b80b4ad4745971d9e5e864e7f30f23b9d00b Mon Sep 17 00:00:00 2001 From: Boris Kurktchiev Date: Mon, 23 Nov 2015 16:49:46 -0500 Subject: [PATCH 1/2] Update index.js Not really sure if thats how the no arguments bit should look, but it would be good to have a -h and at least spit out something when you run it with no arguments :) --- index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index fc56438..084ee86 100755 --- a/index.js +++ b/index.js @@ -107,7 +107,7 @@ function getFilter(tagString) { } function run() { - var configFileLocation + var configFileLocation if (argv.C) { configFileLocation = argv.C } else if (fileExists(I2CSSH_CONFIG_FILE)) { @@ -118,7 +118,7 @@ function run() { config = yaml.safeLoad(fs.readFileSync(configFileLocation, 'utf8')); } - initConfig() + initConfig() if (argv.t) { promises.push(parseTags(argv.t)) @@ -127,6 +127,14 @@ function run() { if (argv.c) { promises.push(parseClusters(argv.c)) } + + if (argv.h) { + console.log("-C -- YAML config file to use\n" + "-c name -- pass in a cluster name defined in your config file\n" + "-t name -- ec2 tag to connect to") + } + + if (argv = null ) { + console.log("-C -- YAML config file to use\n" + "-c name -- pass in a cluster name defined in your config file\n" + "-t name -- ec2 tag to connect to") + } Promise.all(promises).then(function(results) { hosts = _.uniq(hosts.concat(_.flatten(results))) From ea9bde961cc9833a92097b6c13a65a006a7b3929 Mon Sep 17 00:00:00 2001 From: Boris Kurktchiev Date: Mon, 23 Nov 2015 16:57:02 -0500 Subject: [PATCH 2/2] Update index.js --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 084ee86..3667fa9 100755 --- a/index.js +++ b/index.js @@ -15,6 +15,7 @@ var argv = require('yargs') .alias('C', 'config') .alias('c', 'clusters') .alias('t', 'tag') + .alias('h', 'help') .argv; var I2CSSH_CONFIG_FILE = process.env.HOME + '/.i2csshrc';