1 | #!/usr/bin/env node
|
2 | "use strict";
|
3 | Object.defineProperty(exports, "__esModule", { value: true });
|
4 | var index_1 = require("./index");
|
5 | var chalk_1 = require("chalk");
|
6 |
|
7 | process.on('uncaughtException', function () { return process.exit(1); });
|
8 |
|
9 | var showedHelp = false;
|
10 | index_1.installCommands()
|
11 | .demandCommand(1, 1, 'Missing command name')
|
12 | .env('GRAPHQL_CONFIG')
|
13 | .strict()
|
14 | .help()
|
15 | .completion('completion', false)
|
16 | .usage("Usage: " + chalk_1.default.green('graphql') + " [command]")
|
17 | .example('graphql init', 'Interactively setup .graphqlconfig file')
|
18 | .example('graphql get-schema -e dev', 'Update local schema to match "dev" endpoint')
|
19 | .example('graphql diff -e dev -t prod', 'Show schema diff between "dev" and "prod" endpoints')
|
20 | .describe('dotenv', 'Path to .env file')
|
21 | .string('dotenv')
|
22 | .alias('p', 'project')
|
23 | .describe('p', 'Project name')
|
24 | .string('p')
|
25 | .alias('h', 'help')
|
26 | .alias('v', 'version')
|
27 | .epilogue('For more information go to https://github.com/graphql-cli/graphql-cli')
|
28 | .fail(function (msg, err, yargs) {
|
29 | if (err)
|
30 | throw err;
|
31 | if (!showedHelp) {
|
32 | yargs.showHelp();
|
33 | showedHelp = true;
|
34 | }
|
35 | if (msg !== 'Missing command name') {
|
36 | console.error(chalk_1.default.red(msg));
|
37 | }
|
38 |
|
39 | }).argv;
|
40 |
|
\ | No newline at end of file |