D3d: CLI MIN cleanups (C18+C22+C23+C25+C26)#8
Merged
Conversation
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
Five MIN findings from the C-audit, all single-file CLI polish. Each commit is one finding so reviewers and bisect tools can trace cleanly. Tested two MIN findings from the audit that turned out to already exit non-zero on trunk (C22 completion no-arg, C27 api -H invalid header) — A4 and unrelated work incidentally fixed them. C22 still gets a text wording polish here.
shithub cache <typo>printed help + exited 0. Cobra's default for unknown subcommands on a parent with noRunEis "show help". Nowcacherejects unknown positional args withunknown subcommand "X" for "shithub cache"and exit 1. Bareshithub cache(no args) still shows help, exit 0.completion(no shell arg) error message said--shell is required. After A4's positional-arg support the help showscompletion <shell>— message now matches:shell is required (one of: ...).repo list --webwas missing. gh has it. Now openshttps://<host>/<owner>?tab=repositories(or the host's "your repos" page for the authenticated user). Note:MarkWebMutuallyExclusiveintegration is left as a TODO comment — depends on D3a (D3a [CRIT]: --web mutually exclusive with --json/--jq/--template (C5+C15) #5) landing first.secret setaccepted lowercase, mixed-case, and leading-digit names. Tightened to gh-compat^[A-Z_][A-Z0-9_]*$, no leading digit, noGITHUB_prefix. Comment in the original code claimed those rules but didn't enforce them.alias set foo "X"silently overwrote an existingfooalias. Now prints! Changing alias foo from <old> to <new>to stderr before re-saving (matches gh exactly).Test plan
TestValidateNameRejectsLowercase/RejectsLeadingDigit/RejectsGithubPrefix/Accepts— four focused tests on the secret regex.shithub cache delete-all→ exit 1, "unknown subcommand"shithub cache(no args) → exit 0, help printedshithub completion→ exit 1, error says "shell is required"make cigreen locally.Notes
repo cloneerror wrap) and C27 (api -Hinvalid header) deliberately not in this PR: both already work correctly on trunk; deeper investigation would be its own batch.