UNPKG

991 BJavaScriptView Raw
1#!/usr/bin/env node
2'use strict'; // eslint-disable-line
3
4// force colors.js to use colors when exporting
5// by passing a SECRET HIDDEN FLAG into claycli, which triggers
6// terminal-logger's colors.js checker
7process.argv.push('--color');
8process.argv.push('always');
9
10// command line interface
11
12const yargs = require('yargs'),
13 updateNotifier = require('update-notifier'),
14 pkg = require('../package.json'),
15 notifier = updateNotifier({
16 pkg
17 });
18
19if (notifier.update) {
20 // note: this will only check for updates once per day
21 notifier.notify();
22 process.exit(0);
23}
24
25yargs
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 // common options
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;