-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod.ts
45 lines (40 loc) · 1.8 KB
/
mod.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
import { Command } from "https://deno.land/x/cliffy@v0.20.1/command/mod.ts";
import { logCommand } from "./src/commands/log-command.ts";
import { statCommand } from "./src/commands/stat-command.ts";
import { intervalCommand } from "./src/commands/interval-command.ts";
async function main(): Promise<void> {
const log = new Command()
.option("--start <date>", "start date", { required: true })
.option("--end <date>", "end date", { required: true })
.option("--query <string>", "query for github search", { required: true })
.option(
"--format <format>",
"output format. The available is json or csv",
{ default: "json" },
)
.action(logCommand);
const stat = new Command()
.option("--input <filepath>", "the input file path")
.option("--start <date>", "start date", { required: true })
.option("--end <date>", "end date", { required: true })
.option("--query <string>", "query for github search", { required: true })
.action(statCommand);
const interval = new Command()
.option("--start <date>", "start date", { required: true })
.option("--end <date>", "end date", { required: true })
.option("--interval-days <date>", "interval date", { required: true })
.option("--query <string>", "query for github search", { required: true })
.action(intervalCommand);
await new Command()
.version("0.2.0")
.option("--input <filepath>", "the input file path")
.option("--start <date>", "start date", { required: true })
.option("--end <date>", "end date", { required: true })
.option("--query <string>", "query for github search", { required: true })
.action(statCommand)
.command("log", log)
.command("stat", stat)
.command("interval", interval)
.parse(Deno.args);
}
main().catch((error) => console.error(error));