Repository navigation
Conversation
urfave#2475 cut the usage in --generate-shell-completion output to its first line, because the completion scripts read one suggestion per line. ToFishCompletion still wrote the whole usage into `-d '...'`, so fish listed the second line of a command's or flag's usage on its own line. It now uses completionUsage too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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:
#2475 cut command and flag usage to its first line in the
--generate-shell-completionoutput, because the completion scripts read one suggestion per line. The static script fromToFishCompletionstill writes the whole usage into-d '...':With that script sourced in fish 4.9.3,
complete -C "app "prints the second line on its own:and
complete -C "app --"does the same withor - for stdout.fish.gonow usescompletionUsagefrom #2475 for both the command and the flag descriptions, so the output isbuild build the project. A usage that starts with a newline gets no-dinstead of an empty one. Help output still shows the full usage.Which issue(s) this PR fixes:
None, found while testing the completion scripts in fish. It is the static-script half of #2475.
Testing
TestFishCompletionUsesFirstLineOfUsagecovers\n,\r\nand a usage starting with a newline. It fails onmain.testdata/expected-help-output.txtnow has one-line descriptions for the three multi-line usages it already had (--log,deleteandset-a-very-long-name); nothing else in the golden file changes.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.The change and the tests were written with Claude Code (AI).
Release Notes
🤖 Generated with Claude Code