mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-24 03:05:41 +00:00
feature(bin) add --no-server
This commit is contained in:
parent
6146ac8710
commit
194796432b
3 changed files with 18 additions and 15 deletions
1
HELP.md
1
HELP.md
|
|
@ -68,6 +68,7 @@ Cloud Commander supports command line parameters:
|
|||
| `-p, --port` | set port number
|
||||
| `-u, --username` | set username
|
||||
| `-ps, --password` | set password
|
||||
| `-ns, --no-server` | do not start server
|
||||
|
||||
If no parameters given Cloud Commander reads information from `~/.cloudcmd.json` and use
|
||||
port from it (`8000` default). if port variables `PORT` or `VCAP_APP_PORT` isn't exist.
|
||||
|
|
|
|||
|
|
@ -21,12 +21,15 @@
|
|||
'port',
|
||||
'password',
|
||||
'username',
|
||||
'online',
|
||||
'offline',
|
||||
],
|
||||
boolean: [
|
||||
'no-server',
|
||||
'auth',
|
||||
'no-auth',
|
||||
'online',
|
||||
'offline'
|
||||
],
|
||||
boolean: ['test', 'repl', 'save'],
|
||||
'repl',
|
||||
'save'],
|
||||
alias: {
|
||||
v: 'version',
|
||||
h: 'help',
|
||||
|
|
@ -38,6 +41,7 @@
|
|||
s: 'save',
|
||||
a: 'auth',
|
||||
na: 'no-auth',
|
||||
ns: 'no-server'
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -45,8 +49,6 @@
|
|||
version();
|
||||
} else if (args.help) {
|
||||
help();
|
||||
} else if (args.test) {
|
||||
test();
|
||||
} else {
|
||||
if (args.repl)
|
||||
repl();
|
||||
|
|
@ -62,19 +64,17 @@
|
|||
else if (args['no-auth'])
|
||||
config('auth', false);
|
||||
|
||||
if (args.online)
|
||||
config('online', true);
|
||||
else if (args.offline)
|
||||
config('offline', false);
|
||||
|
||||
if (args.save)
|
||||
config.save(start);
|
||||
else
|
||||
start();
|
||||
}
|
||||
|
||||
function test() {
|
||||
console.log('Cloud Commander testing mode');
|
||||
console.log('argv: ', argv);
|
||||
|
||||
require('..');
|
||||
}
|
||||
|
||||
function version() {
|
||||
console.log('v' + Info.version);
|
||||
}
|
||||
|
|
@ -82,7 +82,8 @@
|
|||
function start(config) {
|
||||
var SERVER = '../lib/server';
|
||||
|
||||
require(SERVER)(config);
|
||||
if (!args['no-server'])
|
||||
require(SERVER)(config);
|
||||
}
|
||||
|
||||
function password(pass) {
|
||||
|
|
|
|||
|
|
@ -8,5 +8,6 @@
|
|||
"-na, --no-auth " : "disable authorization",
|
||||
"-p, --port " : "set port number",
|
||||
"-u, --username " : "set username",
|
||||
"-ps, --password" : "set password"
|
||||
"-ps, --password" : "set password",
|
||||
"-ns, --no-server" : "do not start server"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue