forked from requarks/wiki
-
Notifications
You must be signed in to change notification settings - Fork 1
/
wiki.js
52 lines (49 loc) · 1.21 KB
/
wiki.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env node
'use strict'
// ===========================================
// Wiki.js
// 1.0.0
// Licensed under AGPLv3
// ===========================================
const init = require('./server/init')
require('yargs') // eslint-disable-line no-unused-expressions
.usage('Usage: node $0 <cmd> [args]')
.command({
command: 'start',
alias: ['boot', 'init'],
desc: 'Start Wiki.js process',
handler: argv => {
init.startDetect()
}
})
.command({
command: 'stop',
alias: ['quit', 'exit'],
desc: 'Stop Wiki.js process',
handler: argv => {
init.stop()
}
})
.command({
command: 'restart',
alias: ['reload'],
desc: 'Restart Wiki.js process',
handler: argv => {
init.restart()
}
})
.command({
command: 'configure [port]',
alias: ['config', 'conf', 'cfg', 'setup'],
desc: 'Configure Wiki.js using the web-based setup wizard',
builder: (yargs) => yargs.default('port', 3000),
handler: argv => {
init.configure(argv.port)
}
})
.recommendCommands()
.demandCommand(1, 'You must provide one of the accepted commands above.')
.help()
.version()
.epilogue('Read the docs at https://wiki.requarks.io')
.argv