feature(bin) add --no-server

This commit is contained in:
coderaiser 2015-03-25 04:02:24 -04:00
parent 6146ac8710
commit 194796432b
3 changed files with 18 additions and 15 deletions

View file

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

View file

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

View file

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