Skip to content

Refine top-level CLI help text#129

Merged
benvinegar merged 1 commit intomainfrom
pr-help-text-top-level
Mar 29, 2026
Merged

Refine top-level CLI help text#129
benvinegar merged 1 commit intomainfrom
pr-help-text-top-level

Conversation

@benvinegar
Copy link
Copy Markdown
Member

Summary

  • reorganize top-level hunk --help into clearer sections
  • surface shared review options like --watch and git diff-specific flags
  • remove top-level config/examples in favor of command-specific help

Testing

  • bun test test/cli.test.ts test/help-output.test.ts
  • bun run typecheck

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 29, 2026

Greptile Summary

This PR refines the top-level hunk --help output by replacing a flat "Options" + "Examples" block with four clearly-labelled sections — Global options, Common review options, Git diff options, and Notes — and both the unit and integration test suites are updated to match.

  • src/core/cli.ts: renderCliHelp() reorganised; examples dropped in favour of a Notes: line pointing users to command-specific --help
  • test/cli.test.ts: assertions updated to verify new section headings and confirm Config: / Examples: are absent
  • test/help-output.test.ts: same assertion updates applied to the integration-level test that spawns the real CLI binary
  • --staged / --cached appear both as a command variant in the Commands section and as flags under Git diff options — this is intentional and improves discoverability, though readers may notice the minor overlap

Confidence Score: 5/5

Safe to merge — purely a documentation/UX change with no logic modifications and fully updated tests.

All changed lines are help-text strings and their corresponding test assertions. No runtime logic was touched, no API contracts changed, and both the unit test and integration test suites cover the new output. No P0 or P1 findings.

No files require special attention.

Important Files Changed

Filename Overview
src/core/cli.ts Refactored renderCliHelp() to replace a flat 'Options' + 'Examples' layout with structured 'Global options', 'Common review options', 'Git diff options', and 'Notes' sections — no logic changes, documentation only.
test/cli.test.ts Updated help-text assertions to match new section headings and removed check for the dropped 'hunk patch -' example line; all other test cases unchanged.
test/help-output.test.ts Mirrored the same assertion updates as cli.test.ts for the integration-level help output test that spawns the real CLI binary.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["hunk / hunk --help"] --> B["renderCliHelp()"]
    B --> C["Usage: hunk <command> [options]"]
    C --> D["Commands section"]
    C --> E["Global options\n(-h, -v)"]
    C --> F["Common review options\n(--mode, --watch, --theme, ...)"]
    C --> G["Git diff options\n(--staged/--cached, --exclude-untracked)"]
    C --> H["Notes\n(run hunk <command> --help)"]
Loading

Reviews (1): Last reviewed commit: "Refine top-level CLI help text" | Re-trigger Greptile

@benvinegar benvinegar merged commit 9b030ac into main Mar 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant