mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(cloudcmd) args: add check of unknown options
This commit is contained in:
parent
43cabc4889
commit
2e21e3aa91
1 changed files with 7 additions and 3 deletions
|
|
@ -13,6 +13,7 @@
|
|||
createPass = require(DIR_SERVER + 'password'),
|
||||
|
||||
argv = process.argv,
|
||||
|
||||
args = require('minimist')(argv.slice(2), {
|
||||
string: [
|
||||
'port',
|
||||
|
|
@ -45,6 +46,9 @@
|
|||
s: 'save',
|
||||
a: 'auth',
|
||||
c: 'config'
|
||||
},
|
||||
unknown: function(cmd) {
|
||||
exit('\'%s\' is not a cloudcmd option. See \'cloudcmd --help\'.', cmd);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -62,7 +66,7 @@
|
|||
config('auth', args.auth);
|
||||
config('online', args.online);
|
||||
config('username', args.username);
|
||||
root(args.root)
|
||||
root(args.root);
|
||||
|
||||
readConfig(args.config);
|
||||
|
||||
|
|
@ -157,8 +161,8 @@
|
|||
require(DIR_LIB + '/server/repl');
|
||||
}
|
||||
|
||||
function exit(message) {
|
||||
console.error(message);
|
||||
function exit() {
|
||||
console.error.apply(console, arguments);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue