1 | #!/usr/bin/env node
|
2 | 'use strict';
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | process.argv.push('--color');
|
8 | process.argv.push('always');
|
9 |
|
10 |
|
11 |
|
12 | const yargs = require('yargs'),
|
13 | updateNotifier = require('update-notifier'),
|
14 | pkg = require('../package.json'),
|
15 | notifier = updateNotifier({
|
16 | pkg
|
17 | });
|
18 |
|
19 | if (notifier.update) {
|
20 |
|
21 | notifier.notify();
|
22 | process.exit(0);
|
23 | }
|
24 |
|
25 | yargs
|
26 | .usage('Usage: clay <command> [options]')
|
27 | .wrap(yargs.terminalWidth())
|
28 | .command(require('./config'))
|
29 | .command(require('./lint'))
|
30 | .command(require('./import'))
|
31 | .command(require('./export'))
|
32 | .command(require('./compile'))
|
33 |
|
34 | .help()
|
35 | .version()
|
36 | .alias({
|
37 | h: 'help',
|
38 | v: 'version'
|
39 | })
|
40 | .demandCommand(1, 'What would you like to do today?')
|
41 | .completion()
|
42 | .argv;
|