-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
tal.ts
52 lines (51 loc) · 1.94 KB
/
tal.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
48
49
50
51
52
import { Command } from "./deps.ts";
import main from "./main.ts";
export default async function tal() {
await new Command()
.name("tal")
.version("0.1.0")
.description("Track Markdown Files Changes")
.env("DEBUG=<enable:boolean>", "Enable debug output.")
.env("FORCE=<enable:boolean>", "Enable force update.")
.env("FORCE_FETCH=<enable:boolean>", "Enable force update fetch.")
.env("PUSH=<enable:boolean>", "Enable push to remote repo.")
.env("REBUILD=<enable:boolean>", "Enable rebuild.")
.env("LIMIT=<enable:number>", "Limit sources to build, for debug.")
.env("DAY_MARKDOWN=<disable:boolean>", "Disable day markdown output.")
.env(
"FETCH_REPO_UPDATES=<disable:boolean>",
"fetch repo updates when init there is a cache. for dev fast test",
)
.option("-d, --debug", "Enable debug output.")
.option("-f, --force", "Force update markdown.")
.option("--force-fetch", "Force update sources.")
.option("--rebuild", "rebuild updates from git repo")
.option("-p, --push", "Push markdown to remote.")
.option("--no-fetch", "Don't fetch remote sources.")
.option("--no-markdown", "do not build markdown file.")
.option("--clean-html", "clean html files.")
.option("--clean-markdown", "clean markdown files.")
.option("--no-day-markdown", "do not build day markdown file.")
.option("--no-fetch-repo-updates", "do not fetch repo updates.")
.option("--html", "Build html files.")
.option("--no-serve", "Serve site.")
.option("--limit <limit:number>", "Limit number of sources to process.")
.option(
"--auto-init",
"auto init db meta, for avoid load remote db failed",
).option(
"--port <port:number>",
"Serve site port.",
{
default: 8000,
},
)
.arguments("[files...:string]")
.action((options, ...args) => {
main(options, ...args);
})
.parse(Deno.args);
}
if (import.meta.main) {
await tal();
}