Repository navigation
Print a completion script whatever the commands above it ask for - #76
Merged
Merged
Conversation
A required option on the root, an invalid value in an inherited option's variable or a constraint on the root stopped `completion <shell>`, though it uses no option's value. The parser now stops after its command line for that command, as it already skipped the settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aoreshkov
force-pushed
the
cli-kit-completion-unconditional
branch
from
November 6, 2026 18:12
64e78f1 to
9db0da2
Compare
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
completion <shell>uses no option's value, but three things from the commands above it could stop it:demo completion bashexits 2 withmissing required option --storeExactlyOneThe parser already skipped settings for this command, so a broken configuration file couldn't stop it. It now returns right after reading the command's own command line, which covers all three and the settings with one check.
Programwas already answeringcompletionwithout a handler.completionis still held to its own command line: a missing or unknown shell is a usage error, and so is an invalid value typed on it. Other commands are held to everything as before.There's no public API change.
Testing
ProgramTest: the new test covers all three cases and failed before the fix withmissing required option --store. It also checks thatgoon the same programs still exits with a usage error. A second test coverscompletion's own command line../gradlew checkis green on Windows. The bash completion and SIGTERM tests are skipped there, so they need this PR's Linux job.:cli-kit:checkand:cli-kit-testing:check, again on Windows only.🤖 Generated with Claude Code