mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(cloudcmd) add --prefix
This commit is contained in:
parent
6b3fbbe9fd
commit
d62049cd59
6 changed files with 19 additions and 4 deletions
2
HELP.md
2
HELP.md
|
|
@ -67,6 +67,7 @@ Cloud Commander supports command line parameters:
|
|||
| `-c, --config` | configuration file path
|
||||
| `--editor` | set editor: "dword" or "edward"
|
||||
| `--root` | set root directory
|
||||
| `--prefix` | set url prefix
|
||||
| `--port` | set port number
|
||||
| `--no-auth` | disable authorization
|
||||
| `--no-server` | do not start server
|
||||
|
|
@ -215,6 +216,7 @@ Here is description of options:
|
|||
"port" : 8000, /* http port */
|
||||
"ip" : null, /* ip or null(default) */
|
||||
"root" : "/" /* root directory */
|
||||
"prefix" : "", /* url prefix */
|
||||
"progress" : true /* show progress of file operations */
|
||||
}
|
||||
```
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@
|
|||
'username',
|
||||
'config',
|
||||
'editor',
|
||||
'root'
|
||||
'root',
|
||||
'prefix'
|
||||
],
|
||||
boolean: [
|
||||
'auth',
|
||||
|
|
@ -42,6 +43,7 @@
|
|||
editor : config('editor') || 'edward',
|
||||
username : config('username'),
|
||||
root : config('root') || '/',
|
||||
prefix : config('prefix') || '',
|
||||
progress : config('progress') || config('progressOfCopying'),
|
||||
},
|
||||
alias: {
|
||||
|
|
@ -83,7 +85,8 @@
|
|||
|
||||
options = {
|
||||
root: args.root,
|
||||
editor: args.editor
|
||||
editor: args.editor,
|
||||
prefix: args.prefix
|
||||
};
|
||||
|
||||
if (args.password)
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
"-c, --config ": "configuration file path",
|
||||
"--editor ": "set editor: \"dword\" or \"edward\"",
|
||||
"--root ": "set root directory",
|
||||
"--prefix ": "set url prefix",
|
||||
"--port ": "set port number",
|
||||
"--no-auth ": "disable authorization",
|
||||
"--no-server ": "do not start server",
|
||||
|
|
|
|||
|
|
@ -17,5 +17,6 @@
|
|||
"port": 8000,
|
||||
"ip": null,
|
||||
"root": "/",
|
||||
"prefix": "",
|
||||
"progress": true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,9 +50,9 @@
|
|||
}
|
||||
|
||||
module.exports = function(params) {
|
||||
var p = params || {},
|
||||
var prefix,
|
||||
p = params || {},
|
||||
options = p.config || {},
|
||||
prefix = p.prefix,
|
||||
keys = Object.keys(options);
|
||||
|
||||
keys.forEach(function(name) {
|
||||
|
|
@ -67,6 +67,13 @@
|
|||
break;
|
||||
case 'password':
|
||||
value = createPass(config('algo'), value);
|
||||
break;
|
||||
case 'prefix':
|
||||
if (!~value.indexOf('/'))
|
||||
value = '/' + value;
|
||||
|
||||
prefix = value;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ programs in browser from any computer, mobile or tablet device.
|
|||
-c, --config configuration file path
|
||||
--editor set editor: "dword" or "edward"
|
||||
--root set root directory
|
||||
--prefix set url prefix
|
||||
--port set port number
|
||||
--no-auth disable authorization
|
||||
--no-server do not start server
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue