feature(cloudcmd) add editor

This commit is contained in:
coderaiser 2015-04-17 09:40:11 -04:00
parent c4b8ca79f2
commit 0caf78841d
3 changed files with 12 additions and 0 deletions

View file

@ -65,6 +65,7 @@ Cloud Commander supports command line parameters:
| `-u, --username` | set username
| `-p, --password` | set password
| `-c, --config` | configuration file path
| `--editor` | set editor: "dword" or "edward"
| `--root` | set root directory
| `--port` | set port number
| `--no-auth` | disable authorization

View file

@ -21,6 +21,7 @@
'password',
'username',
'config',
'editor',
'root'
],
boolean: [
@ -37,6 +38,7 @@
port : config('port'),
minify : config('minify'),
online : config('online'),
editor : config('editor'),
username : config('username'),
},
alias: {
@ -70,6 +72,7 @@
config('minify', args.minify);
config('username', args.username);
root(args.root);
editor(args.editor);
readConfig(args.config);
@ -165,6 +168,13 @@
}
function editor(name) {
var reg = /^(dword|edward)$/;
if (!reg.test(name))
exit('cloudcmd --editor: could be "dword" or "edward" only');
}
function repl() {
console.log('REPL mode enabled (telnet localhost 1337)');
require(DIR_LIB + '/server/repl');

View file

@ -7,6 +7,7 @@
"-u, --username " : "set username",
"-p, --password " : "set password",
"-c, --config " : "configuration file path",
"--editor " : "set editor: \"dword\" or \"edward\"",
"--root " : "set root directory",
"--port " : "set port number",
"--no-auth " : "disable authorization",