forked from typeorm/typeorm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.ts
47 lines (45 loc) · 1.82 KB
/
cli.ts
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
#!/usr/bin/env node
import "reflect-metadata";
import * as yargs from "yargs";
import {SchemaSyncCommand} from "./commands/SchemaSyncCommand";
import {SchemaDropCommand} from "./commands/SchemaDropCommand";
import {QueryCommand} from "./commands/QueryCommand";
import {EntityCreateCommand} from "./commands/EntityCreateCommand";
import {MigrationCreateCommand} from "./commands/MigrationCreateCommand";
import {MigrationRunCommand} from "./commands/MigrationRunCommand";
import {MigrationRevertCommand} from "./commands/MigrationRevertCommand";
import {MigrationShowCommand} from "./commands/MigrationShowCommand";
import {SubscriberCreateCommand} from "./commands/SubscriberCreateCommand";
import {SchemaLogCommand} from "./commands/SchemaLogCommand";
import {MigrationGenerateCommand} from "./commands/MigrationGenerateCommand";
import {VersionCommand} from "./commands/VersionCommand";
import {InitCommand} from "./commands/InitCommand";
import {CacheClearCommand} from "./commands/CacheClearCommand";
yargs
.usage("Usage: $0 <command> [options]")
.command(new SchemaSyncCommand())
.command(new SchemaLogCommand())
.command(new SchemaDropCommand())
.command(new QueryCommand())
.command(new EntityCreateCommand())
.command(new SubscriberCreateCommand())
.command(new MigrationCreateCommand())
.command(new MigrationGenerateCommand())
.command(new MigrationRunCommand())
.command(new MigrationShowCommand())
.command(new MigrationRevertCommand())
.command(new VersionCommand())
.command(new CacheClearCommand())
.command(new InitCommand())
.recommendCommands()
.demandCommand(1)
.strict()
.alias("v", "version")
.help("h")
.alias("h", "help")
.argv;
require("yargonaut")
.style("blue")
.style("yellow", "required")
.helpStyle("green")
.errorsStyle("red");