-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
demo.ts
executable file
路27 lines (25 loc) 路 830 Bytes
/
demo.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
#!/usr/bin/env -S deno run
import { Command } from "../../command/command.ts";
import { CompletionsCommand } from "../../command/completions/mod.ts";
import { HelpCommand } from "../../command/help/mod.ts";
await new Command()
.name("cliffy")
.version("1.0.0")
.description(`Command line framework for Deno`)
.option("-p, --beep", "Some option.", {
default: true,
})
.option("--no-beep", "Negate beep.")
.option("-f, --foo [value:string]", "Some string value.", {
default: "foo",
})
.option("-b, --bar [value:number]", "Some numeric value.", {
default: 89,
depends: ["foo"],
})
.option("-B, --baz <value:boolean>", "Some boolean value.", {
conflicts: ["beep"],
})
.command("help", new HelpCommand().global())
.command("completions", new CompletionsCommand())
.parse(Deno.args);