feat(cli): add --help flag with rich usage output - #89
Merged
Conversation
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.
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. |
itsakhilyou
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
--help/-hflag to theydcCLI 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
-has 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 1This keeps
stdoutreserved 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 --helpprints the same help for the -h short flaglists every allowlisted tool and flag in the help outputprints help to stderr and exits non-zero when no command is givenrejects unknown commands immediatelycheck:typesandcheck:biomecleanReferences