This repository has been archived by the owner on Jan 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
67 lines (55 loc) · 1.46 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env node
'use strict';
// import * as yargs from 'yargs'; // Can't use this because it breaks --help
import yargs = require('yargs');
yargs
// Config options
.options({
's': {
alias: 'server',
demandOption: true,
describe: 'The server to connect to.',
type: 'string'
},
'u': {
alias: 'username',
describe: 'The username to login with.',
type: 'string',
conflicts: 'key',
implies: 'password'
},
'p': {
alias: 'password',
describe: 'The password to login with.',
type: 'string',
conflicts: 'key',
implies: 'username'
},
'k': {
alias: 'key',
describe: 'An existing session key to use (cc.collabd_session_guid).',
type: 'string',
conflicts: ['username', 'password']
}
})
// Source the config.json file
.config({
extends: './config.json'
})
// Source PM_* environment variables
.env('PM')
// Use commands in ./commands
.commandDir('commands')
// Force using a command
.demandCommand()
// Recommend spelling fixes
.recommendCommands()
// Throw on invalid options/commands
.strict()
// Enable help
.help('help')
.alias('h', 'help')
// Enable version
.version('version')
.alias('v', 'version')
.parse();