-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdoclt.js
executable file
·38 lines (34 loc) · 922 Bytes
/
doclt.js
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
#!/usr/bin/env node
/**
* @fileoverview Main executable file for the doclt CLI.
* @author [email protected] (Alvin Lin)
*/
const yargs = require('yargs')
const util = require('./lib/util')
const VERSION = require('./package.json').version
try {
yargs.commandDir('commands')
.completion('completion', 'Generate bash completion script'.yellow)
.demandCommand()
.help('help', 'Show help for a command'.yellow)
.option('dev', {
hidden: true,
'boolean': true
})
.option('json', {
description: 'Output results as JSON'.yellow,
'boolean': true
})
.option('no-color', {
description: 'Disable colors'.yellow,
'boolean': true
})
.recommendCommands()
.scriptName('doclt')
.strict()
.version('version', 'Show version number'.yellow, VERSION)
.wrap(yargs.terminalWidth())
.parse()
} catch (error) {
util.handleFail(error)
}