Repository navigation
chore(fish): say what -f does in fishAddFileFlag - #2504
Merged
Merged
Conversation
The comment described the type switch that the takesFile method replaced in urfave#2500. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Juneezee
approved these changes
Oct 25, 2026
Juneezee
left a comment
Member
There was a problem hiding this comment.
Thanks! The new comment is accurate:
Lines 163 to 169 in a2cf6e0
Checked with fish 4.9.3: -f only stops file names for the flag's own value. complete -C 'app --name ' lists nothing for a StringFlag, while complete -C 'app --verbose ' (a BoolFlag, also -f) still lists files for the next argument.
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:
Follow-up to the review of #2500. The comment in
fishAddFileFlagdescribed the type switch that thetakesFilemethod replaced ("TakesFile is a field of every flag type, not only StringFlag and StringSliceFlag"), which only makes sense next to the old code.fish.go: the comment now says what-fdoes, worded as suggested in the review:-f stops fish from completing file names for the flag's value. It sits above the-fit describes. fish'scompletedocumentation says the same thing about-f/--no-files: "This completion may not be followed by a filename."No behavior change: the generated fish script is the same, and the example binary is the same size (only the line table differs, since the
ifmoved up one line).Which issue(s) this PR fixes:
None, a review suggestion on #2500.
Testing
make(generate, vet, tests, binary size, gfmrun),make lintandmake v3diffpass.go test -racepasses, as do the tests withurfave_cli_no_template,urfave_cli_no_docsandurfave_cli_no_suggest.mainand on this branch: both binaries are 3,747,964 bytes.The change was written with Claude Code (AI).
Release Notes
🤖 Generated with Claude Code