aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohannes Zellner <johannes@nebulon.de>2016-03-01 12:38:39 +0100
committerJohannes Zellner <johannes@nebulon.de>2016-03-01 12:38:39 +0100
commit24545229fc52aa6d948f9081472e65c7f17eaa14 (patch)
treeb10af796f430517f83b4ff6fb03f1abdbbe74673
parentc9d33e20bf7d74b0d8a7eb1e1c89e8a845098460 (diff)
downloadSurfer-24545229fc52aa6d948f9081472e65c7f17eaa14.tar.gz
Surfer-24545229fc52aa6d948f9081472e65c7f17eaa14.tar.zst
Surfer-24545229fc52aa6d948f9081472e65c7f17eaa14.zip
Require a file argument for delete
-rw-r--r--cli/actions.js3
-rwxr-xr-xcli/surfer.js6
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
22program.command('get [file]') 22program.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
26program.command('del') 26program.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
30program.parse(process.argv); 30program.parse(process.argv);