diff options
author | Johannes Zellner <johannes@nebulon.de> | 2016-03-01 12:38:39 +0100 |
---|---|---|
committer | Johannes Zellner <johannes@nebulon.de> | 2016-03-01 12:38:39 +0100 |
commit | 24545229fc52aa6d948f9081472e65c7f17eaa14 (patch) | |
tree | b10af796f430517f83b4ff6fb03f1abdbbe74673 /cli | |
parent | c9d33e20bf7d74b0d8a7eb1e1c89e8a845098460 (diff) | |
download | Surfer-24545229fc52aa6d948f9081472e65c7f17eaa14.tar.gz Surfer-24545229fc52aa6d948f9081472e65c7f17eaa14.tar.zst Surfer-24545229fc52aa6d948f9081472e65c7f17eaa14.zip |
Require a file argument for delete
Diffstat (limited to 'cli')
-rw-r--r-- | cli/actions.js | 3 | ||||
-rwxr-xr-x | cli/surfer.js | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/cli/actions.js b/cli/actions.js index 7a361b7..59f0714 100644 --- a/cli/actions.js +++ b/cli/actions.js | |||
@@ -188,6 +188,7 @@ function del(filePath) { | |||
188 | if (error && error.status === 401) return console.log('Login failed'); | 188 | if (error && error.status === 401) return console.log('Login failed'); |
189 | if (error && error.status === 404) return console.log('No such file or directory'); | 189 | if (error && error.status === 404) return console.log('No such file or directory'); |
190 | if (error) return console.log('Failed', result ? result.body : error); | 190 | if (error) return console.log('Failed', result ? result.body : error); |
191 | console.log('Success', result.body); | 191 | |
192 | console.log('Success. Removed %s files.', result.body.entries.length); | ||
192 | }); | 193 | }); |
193 | } | 194 | } |
diff --git a/cli/surfer.js b/cli/surfer.js index b311658..278724d 100755 --- a/cli/surfer.js +++ b/cli/surfer.js | |||
@@ -20,11 +20,11 @@ program.command('put <file> [files...]') | |||
20 | .action(actions.put); | 20 | .action(actions.put); |
21 | 21 | ||
22 | program.command('get [file]') | 22 | program.command('get [file]') |
23 | .description('Get a file or directory') | 23 | .description('Get a file or directory listing') |
24 | .action(actions.get); | 24 | .action(actions.get); |
25 | 25 | ||
26 | program.command('del') | 26 | program.command('del <file>') |
27 | .description('Delete a file') | 27 | .description('Delete a file or directory') |
28 | .action(actions.del); | 28 | .action(actions.del); |
29 | 29 | ||
30 | program.parse(process.argv); | 30 | program.parse(process.argv); |