diff options
author | Johannes Zellner <johannes@cloudron.io> | 2017-02-09 15:32:31 +0100 |
---|---|---|
committer | Johannes Zellner <johannes@cloudron.io> | 2017-02-09 15:32:31 +0100 |
commit | ba93623cc0d9a2147856a1ae1835b146fb160c94 (patch) | |
tree | 500954a439f88dbe7ccb2e2d54307b14f150baac | |
parent | f173d2d7a502fba9935d5cd5974fd5af129b29d9 (diff) | |
download | Surfer-ba93623cc0d9a2147856a1ae1835b146fb160c94.tar.gz Surfer-ba93623cc0d9a2147856a1ae1835b146fb160c94.tar.zst Surfer-ba93623cc0d9a2147856a1ae1835b146fb160c94.zip |
Fix cli help output
-rw-r--r-- | cli/actions.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/actions.js b/cli/actions.js index 5ad9dc6..996ef7f 100644 --- a/cli/actions.js +++ b/cli/actions.js | |||
@@ -24,7 +24,7 @@ var gQuery = {}; | |||
24 | 24 | ||
25 | function checkConfig() { | 25 | function checkConfig() { |
26 | if (!config.server() || !config.accessToken()) { | 26 | if (!config.server() || !config.accessToken()) { |
27 | console.log('You have run "login" first'); | 27 | console.log('Run %s first', 'surfer login'.yellow); |
28 | process.exit(1); | 28 | process.exit(1); |
29 | } | 29 | } |
30 | 30 | ||
@@ -92,9 +92,9 @@ function login(uri) { | |||
92 | } | 92 | } |
93 | 93 | ||
94 | function logout() { | 94 | function logout() { |
95 | checkConfig(); | 95 | if (!config.accessToken()) return console.log('Done'.green); |
96 | 96 | ||
97 | superagent.post(config.server() + '/api/logout').query(gQuery).end(function (error, result) { | 97 | superagent.post(config.server() + '/api/logout').query({ access_token: config.accessToken() }).end(function (error, result) { |
98 | if (result && result.statusCode !== 200) console.log('Failed to logout: ' + result.statusCode); | 98 | if (result && result.statusCode !== 200) console.log('Failed to logout: ' + result.statusCode); |
99 | if (error) console.log(error); | 99 | if (error) console.log(error); |
100 | 100 | ||