-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod.ts
33 lines (31 loc) · 884 Bytes
/
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
import { check, help as checkHelp } from "./check/mod.ts";
import { comment, help as commentHelp } from "./comment/mod.ts";
import { help as publishHelp, publish } from "./publish/mod.ts";
import { commandLineArgument } from "./utilities/command-line-arguments/mod.ts";
const commandLineArguments = await commandLineArgument();
/** $ documentaly <commands> */
switch (commandLineArguments.command) {
case "check":
if (commandLineArguments.helpFlag) {
checkHelp();
break;
}
check(commandLineArguments);
break;
case "comment":
if (commandLineArguments.helpFlag) {
commentHelp();
break;
}
comment(commandLineArguments);
break;
case "publish":
if (commandLineArguments.helpFlag) {
publishHelp();
break;
}
publish(commandLineArguments);
break;
default:
throw new Error("invalid command");
}