diff --git a/HELP.md b/HELP.md index e962d77a..b6e4dc22 100644 --- a/HELP.md +++ b/HELP.md @@ -61,6 +61,8 @@ Cloud Commander supports command line parameters: | `-h, --help` | display help and exit | `-v, --version` | output version information and exit | `-s, --save` | save options +| `-a, --auth` | enable authorization +| `-na, --no-auth` | disable authorization | `-p, --port` | set port number | `-u, --username` | set username | `-ps, --password` | set password diff --git a/bin/cloudcmd.js b/bin/cloudcmd.js index da4c4fe0..c8bae119 100755 --- a/bin/cloudcmd.js +++ b/bin/cloudcmd.js @@ -17,7 +17,7 @@ argv = process.argv, args = require('minimist')(argv.slice(2), { - string: ['port', 'password', 'username'], + string: ['port', 'password', 'username', 'auth', 'no-auth'], boolean: ['test', 'repl', 'save'], alias: { v: 'version', @@ -25,7 +25,9 @@ p: 'port', u: 'username', ps: 'password', - s: 'save' + s: 'save', + a: 'auth', + na: 'no-auth', } }); @@ -45,6 +47,11 @@ username(args.username); port(args.port); + if (args.auth) + config('auth', true); + else if (args['no-auth']) + config('auth', false); + if (args.save) config.save(start); else diff --git a/json/bin.json b/json/bin.json index 39b38a62..2a93043c 100644 --- a/json/bin.json +++ b/json/bin.json @@ -2,6 +2,8 @@ "-h, --help " : "display this help and exit", "-v, --version " : "output version information and exit", "-s, --save " : "save options", + "-a, --auth " : "enable authorization", + "-na, --no-auth " : "disable authorization", "-p, --port " : "set port number", "-u, --username " : "set username", "-ps, --password" : "set password"