-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.js
executable file
·38 lines (38 loc) · 1.2 KB
/
cli.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
require('yargs')
.command({
command: 'generate [directory]',
aliases: ['gen', 'g'],
desc: 'Recursively looks for .templateroots in the current directory, or supplied directory',
builder: yargs => yargs.default('directory', './'),
handler: argv => require('./src/generate/root').run(argv.directory),
})
.command({
command: 'create [directory] [--overwrite]',
aliases: ['c'],
desc: 'Create a starting .templateroot in to the current directory, or supplied directory',
builder: yargs => yargs.default('directory', './example.templateroot'),
handler: argv => require('./src/create').run(argv.directory),
})
.options({
'dry-run': {
boolean: true,
describe: 'Logs the changes that would be made without actually touching the file system.',
},
'into': {
string: true,
describe: 'Overrides the directory that .templateroots will target. Useful for targeting dynamic directories.',
},
'silent': {
boolean: true,
describe: 'Disables console logging.',
},
'no-colors': {
boolean: true,
describe: 'Turns off console coloring of text.',
},
})
.demandCommand()
.help()
.wrap(72)
.argv;