Skip to content

feat(cli): add --help flag with rich usage output - #89

Merged
EdwardIrby merged 1 commit into
mainfrom
feat/add-help-to-cli
Jul 7, 2026
Merged

feat(cli): add --help flag with rich usage output#89
EdwardIrby merged 1 commit into
mainfrom
feat/add-help-to-cli

Conversation

@EdwardIrby

Copy link
Copy Markdown
Member

Summary

Adds a --help / -h flag to the ydc CLI with a sectioned usage block, following the plaited CLI pattern.

Replaces the minimal 3-line usage string with a structured help block (Commands, Tools, Flags, Environment) and adds -h as a short alias for --help.

Behavior change

  • ydc --help / ydc -h → help to stdout, exit 0 (deliberate success)
  • ydc (no command) → help to stderr, exit 1 (nothing actionable given)
  • ydc <unknown> → unchanged: error to stderr, exit 1

This keeps stdout reserved for JSON results or explicit help, so script/agent callers can reliably distinguish a successful command from a missing one.

Test plan

  • prints plain-text help for --help
  • prints the same help for the -h short flag
  • lists every allowlisted tool and flag in the help output
  • prints help to stderr and exits non-zero when no command is given
  • rejects unknown commands immediately
  • Existing 14 tests unchanged and passing
  • check:types and check:biome clean

References

Replace the minimal 3-line usage string with a sectioned help block
(commands, tools, flags, environment) and add -h as a short alias for
--help, following the plaited CLI pattern.

Bare  now prints help to stderr and exits 1 (nothing actionable
given), while explicit / prints to stdout and exits 0.
This keeps stdout reserved for JSON results or explicit help, so
script/agent callers can distinguish a successful command from a
missing one.
@EdwardIrby
EdwardIrby requested a review from a team as a code owner July 1, 2026 19:12
@factory-droid

factory-droid Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Droid finished @EdwardIrby's task —— View job


Droid is reviewing code and running a security check…

Review complete. Clean PR that adds a structured --help/-h flag to the ydc CLI and correctly separates the no-command case (stderr, exit 1) from the explicit help request (stdout, exit 0). Control flow, test coverage, and documentation are all consistent with the stated behavior. No issues found.

@EdwardIrby
EdwardIrby merged commit 2d1598d into main Jul 7, 2026
5 checks passed
@EdwardIrby
EdwardIrby deleted the feat/add-help-to-cli branch July 7, 2026 20:02
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.

2 participants