feature(bin) add --auth, --no-auth

This commit is contained in:
coderaiser 2015-03-24 11:30:53 -04:00
parent 03e9cbe7f3
commit d1f967b851
3 changed files with 13 additions and 2 deletions

View file

@ -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

View file

@ -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

View file

@ -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"