-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathindex.js
executable file
·68 lines (64 loc) · 2.25 KB
/
index.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#! /usr/bin/env node
/** Required to set max width of the help commands */
const oldWidth = process.stdout.columns
process.stdout.columns = 100
/** ---------------------------------------------- */
const program = require("commander");
const chalk = require("chalk");
const { version } = require("./package.json");
const { commandDescriptions, cliConfig } = require("./lib/parser");
const { client } = require("./lib/commands/generic");
const { login, logout } = require("./lib/commands/generic");
const { init } = require("./lib/commands/init");
const { deploy } = require("./lib/commands/deploy");
const { account } = require("./lib/commands/account");
const { avatars } = require("./lib/commands/avatars");
const { console } = require("./lib/commands/console");
const { databases } = require("./lib/commands/databases");
const { functions } = require("./lib/commands/functions");
const { graphql } = require("./lib/commands/graphql");
const { health } = require("./lib/commands/health");
const { locale } = require("./lib/commands/locale");
const { projects } = require("./lib/commands/projects");
const { storage } = require("./lib/commands/storage");
const { teams } = require("./lib/commands/teams");
const { users } = require("./lib/commands/users");
const { flutter } = require("./lib/commands/flutter");
const { generate } = require("./lib/commands/generate");
program
.description(commandDescriptions['main'])
.configureHelp({
helpWidth: process.stdout.columns || 80,
sortSubcommands: true
})
.version(version, "-v, --version")
.option("--verbose", "Show complete error log")
.option("--json", "Output in JSON format")
.on("option:json", () => {
cliConfig.json = true;
})
.on("option:verbose", () => {
cliConfig.verbose = true;
})
.showSuggestionAfterError()
.addCommand(login)
.addCommand(init)
.addCommand(deploy)
.addCommand(logout)
.addCommand(account)
.addCommand(avatars)
.addCommand(console)
.addCommand(databases)
.addCommand(functions)
.addCommand(graphql)
.addCommand(health)
.addCommand(locale)
.addCommand(projects)
.addCommand(storage)
.addCommand(teams)
.addCommand(users)
.addCommand(client)
.addCommand(flutter)
.addCommand(generate)
.parse(process.argv);
process.stdout.columns = oldWidth;