-
Notifications
You must be signed in to change notification settings - Fork 1
/
cli.ts
28 lines (27 loc) · 808 Bytes
/
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
import { Command, resolve } from "./deps.ts";
import { generate } from "./src/generate.ts";
import { dev } from "./src/dev.ts";
import { build } from "./src/build.ts";
await new Command()
.name("pyro")
.version("0.6.4")
.description("The documentation site generator for Deno")
.command("gen", "Generate a Pyro site.")
.arguments("<path:string>")
.action((_, p) => {
generate(resolve(p));
})
.command("dev", "Start the Pyro dev server")
.option("-p, --port <value:number>", "Specify a port for the the dev server")
.option(
"-n, --hostname <value:string>",
"Specify a hostname for the dev server",
)
.action(({ port, hostname }) => {
dev(hostname, port);
})
.command("build", "Build the static Pyro site")
.action(() => {
build();
})
.parse(Deno.args);