Skip to content

Commit 9b030ac

Browse files
authored
Refine top-level CLI help text (#129)
1 parent 106529b commit 9b030ac

3 files changed

Lines changed: 38 additions & 14 deletions

File tree

src/core/cli.ts

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,27 @@ function renderCliHelp() {
119119
" hunk session <subcommand> inspect or control a live Hunk session",
120120
" hunk mcp serve run the local Hunk session daemon",
121121
"",
122-
"Options:",
122+
"Global options:",
123123
" -h, --help show help",
124124
" -v, --version show version",
125125
"",
126-
"Examples:",
127-
" hunk diff",
128-
" hunk diff main",
129-
" hunk diff main...feature",
130-
" hunk diff --staged -- src/ui/App.tsx",
131-
" hunk show",
132-
" hunk show HEAD~1",
133-
" hunk show abc123 -- README.md",
134-
" hunk patch -",
135-
" hunk pager",
136-
" hunk session list",
137-
" hunk mcp serve",
126+
"Common review options:",
127+
" --mode <mode> layout mode: auto, split, stack",
128+
" --watch auto-reload when the current diff input changes",
129+
" --agent-context <path> JSON sidecar with agent rationale",
130+
" --pager use pager-style chrome and controls",
131+
" --line-numbers / --no-line-numbers show or hide line numbers",
132+
" --wrap / --no-wrap wrap or truncate long diff lines",
133+
" --hunk-headers / --no-hunk-headers show or hide hunk metadata rows",
134+
" --agent-notes / --no-agent-notes show or hide agent notes by default",
135+
" --theme <theme> named theme override",
136+
"",
137+
"Git diff options:",
138+
" --staged, --cached review staged changes",
139+
" --exclude-untracked hide untracked files in working tree reviews",
140+
"",
141+
"Notes:",
142+
" Run `hunk <command> --help` for command-specific syntax and options.",
138143
"",
139144
].join("\n");
140145
}

test/cli.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,16 @@ describe("parseCli", () => {
3333
expect(parsed.text).toContain("Usage:");
3434
expect(parsed.text).toContain("hunk diff");
3535
expect(parsed.text).toContain("hunk show");
36-
expect(parsed.text).toContain("hunk patch -");
36+
expect(parsed.text).toContain("Global options:");
37+
expect(parsed.text).toContain("Common review options:");
38+
expect(parsed.text).toContain("auto-reload when the current diff input changes");
39+
expect(parsed.text).toContain("Git diff options:");
40+
expect(parsed.text).toContain("Notes:");
41+
expect(parsed.text).toContain(
42+
"Run `hunk <command> --help` for command-specific syntax and options.",
43+
);
44+
expect(parsed.text).not.toContain("Config:");
45+
expect(parsed.text).not.toContain("Examples:");
3746
});
3847

3948
test("prints the same top-level help for --help", async () => {

test/help-output.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ describe("CLI help output", () => {
3535
expect(stdout).toContain("Usage:");
3636
expect(stdout).toContain("hunk diff");
3737
expect(stdout).toContain("hunk show");
38+
expect(stdout).toContain("Global options:");
39+
expect(stdout).toContain("Common review options:");
40+
expect(stdout).toContain("auto-reload when the current diff input changes");
41+
expect(stdout).toContain("Git diff options:");
42+
expect(stdout).toContain("Notes:");
43+
expect(stdout).toContain(
44+
"Run `hunk <command> --help` for command-specific syntax and options.",
45+
);
46+
expect(stdout).not.toContain("Config:");
47+
expect(stdout).not.toContain("Examples:");
3848
expect(stdout).toContain("hunk pager");
3949
expect(stdout).toContain("hunk session <subcommand>");
4050
expect(stdout).toContain("hunk mcp serve");

0 commit comments

Comments
 (0)