Repository navigation
Conversation
vidigoat
force-pushed
the
fix/complete-no-flag-after-its-alias
branch
from
October 25, 2026 15:04
59fb729 to
09ecbce
Compare
This was referenced Oct 25, 2026
coilysiren
reviewed
Oct 26, 2026
| desiredMaxBinarySize = 2.2 | ||
| desiredMinBinarySize = 1.49 | ||
| desiredMaxBinarySize = 2.3 | ||
| desiredMinBinarySize = 1.59 |
Contributor
Author
vidigoat
force-pushed
the
fix/complete-no-flag-after-its-alias
branch
from
October 27, 2026 02:28
09ecbce to
0dabab6
Compare
printFlagSuggestions trims the dashes so that "-co" can suggest "--config", but it did the same for a short flag such as "-c", and suggested every long flag starting with "c", including the flag "-c" belongs to. Since the shell scripts send the same request for "app -c <TAB>", they offered "--config" as the value of "-c". A short flag written out in full is that flag, so suggest nothing for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vidigoat
force-pushed
the
fix/complete-no-flag-after-its-alias
branch
from
October 29, 2026 10:19
0dabab6 to
b71450e
Compare
This branch has not been deployed
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.
What type of PR is this?
What this PR does / why we need it:
printFlagSuggestionstrims the dashes from the last argument so that-cocan suggest--config. It does the same for a short flag written out in full, so-csuggests every long flag starting withc, including the one-cis an alias of. The shell scripts send the same request forapp -c<TAB>andapp -c <TAB>, so with a space they offer--configas the value of-c:In bash 5.3,
app -c <TAB>fills inapp -c --configinstead of falling back to file names. fish 4.9.3 offers--configtoo, and zsh calls_describewith it instead of falling back to_files. Subcommands behave the same way (app sub -c <TAB>).A short flag written out in full (
-plus one letter that names a flag) is now that flag, soprintFlagSuggestionsprints nothing for it. The shells then fall back to their defaults: file names in bash and zsh.-co,--cand a lone-suggest the same flags as before.Which issue(s) this PR fixes:
None, found while testing the generated scripts in bash and fish.
Testing
TestCompletionAfterShortFlag:-con the root command and on a subcommand prints nothing (both fail onmain, which prints--configand--count);-coand--cstill suggest--configand--count.app -c <TAB>no longer offers--config, andapp --c<TAB>andapp -<TAB>are unchanged.make(generate, vet, tests, binary size, gfmrun),make lintandmake v3diffpass locally with Go 1.26.go test -racepasses, as do the tests withurfave_cli_no_template,urfave_cli_no_docsandurfave_cli_no_suggest.The change and the test were written with Claude Code (AI).
Release Notes
🤖 Generated with Claude Code