diff --git a/HELP.md b/HELP.md index 9d436a1e..1e5d3b54 100644 --- a/HELP.md +++ b/HELP.md @@ -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 diff --git a/bin/cloudcmd.js b/bin/cloudcmd.js index fe470565..8ccfa878 100755 --- a/bin/cloudcmd.js +++ b/bin/cloudcmd.js @@ -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'); diff --git a/json/bin.json b/json/bin.json index 78f526d6..6be4345a 100644 --- a/json/bin.json +++ b/json/bin.json @@ -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",