diff options
Diffstat (limited to 'cli/surfer.js')
-rwxr-xr-x | cli/surfer.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/cli/surfer.js b/cli/surfer.js index 65773e3..33b4db6 100755 --- a/cli/surfer.js +++ b/cli/surfer.js | |||
@@ -7,6 +7,10 @@ var program = require('commander'), | |||
7 | 7 | ||
8 | program.version(require('../package.json').version); | 8 | program.version(require('../package.json').version); |
9 | 9 | ||
10 | // Those override the login settings if provided | ||
11 | program.option('-s, --server <url>', 'Server URL (optional)'); | ||
12 | program.option('-t, --token <access token>', 'Server Access Token (optional)'); | ||
13 | |||
10 | program.command('login <url>') | 14 | program.command('login <url>') |
11 | .description('Login to server') | 15 | .description('Login to server') |
12 | .option('--username [username]', 'Username (optional)') | 16 | .option('--username [username]', 'Username (optional)') |
@@ -37,9 +41,9 @@ program.parse(process.argv); | |||
37 | if (!process.argv.slice(2).length) { | 41 | if (!process.argv.slice(2).length) { |
38 | program.outputHelp(); | 42 | program.outputHelp(); |
39 | } else { // https://github.com/tj/commander.js/issues/338 | 43 | } else { // https://github.com/tj/commander.js/issues/338 |
40 | var knownCommand = program.commands.some(function (command) { return command._name === process.argv[2]; }); | 44 | // var knownCommand = program.commands.some(function (command) { return command._name === process.argv[2]; }); |
41 | if (!knownCommand) { | 45 | // if (!knownCommand) { |
42 | console.error('Unknown command: ' + process.argv[2]); | 46 | // console.error('Unknown command: ' + process.argv[2]); |
43 | process.exit(1); | 47 | // process.exit(1); |
44 | } | 48 | // } |
45 | } | 49 | } |