UNPKG

1.41 kBJavaScriptView Raw
1#!/usr/bin/env node
2"use strict";
3Object.defineProperty(exports, "__esModule", { value: true });
4var index_1 = require("./index");
5var chalk_1 = require("chalk");
6/* Cleanup */
7process.on('uncaughtException', function () { return process.exit(1); });
8/* Main */
9var showedHelp = false;
10index_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; // preserve stack
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 // tslint:disable-next-line
39}).argv;
40//# sourceMappingURL=bin.js.map
\No newline at end of file