mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(bin) add --auth, --no-auth
This commit is contained in:
parent
03e9cbe7f3
commit
d1f967b851
3 changed files with 13 additions and 2 deletions
2
HELP.md
2
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue