@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 49 lines 1.57 KB
Raw
1 import { expect, it } from "@alchemy.run/test";
2 import * as Context from "effect/Context";
3 import * as Option from "effect/Option";
4 import { plainCliFormatter } from "@/Cli/PlainCliFormatter.ts";
5
6 it(
7 "compacts enum flag types and bounds every line",
8 () => {
9 const output = plainCliFormatter({ columns: 80 }).formatHelpDoc({
10 description:
11 "Define, deploy, and operate cloud infrastructure with type-safe Effect programs. " +
12 "This description is deliberately long enough that the default formatter would " +
13 "emit a line wider than eighty columns without wrapping.",
14 usage: "alchemy <subcommand> [flags]",
15 annotations: Context.empty(),
16 flags: [],
17 globalFlags: [
18 {
19 name: "log-level",
20 aliases: [],
21 type: "all|trace|debug|info|warn|warning|error|fatal|none",
22 description: Option.some("Sets the minimum log level for every command and provider."),
23 required: false,
24 },
25 ],
26 subcommands: [
27 {
28 group: undefined,
29 commands: [
30 {
31 name: "deploy",
32 alias: undefined,
33 shortDescription: "Deploy a stack",
34 description: "Deploy a stack",
35 },
36 ],
37 },
38 ],
39 examples: [{ command: "alchemy deploy" }],
40 });
41
42 // The nine-choice enum must not widen the flag column.
43 expect(output).toContain("--log-level all|trace|…");
44 for (const line of output.split("\n")) {
45 expect(line.length <= 80).toBe(true);
46 }
47 },
48 { tags: ["unit", "local"] },
49 );