Expose shell completions scripts in by default in the completion
command
#1904
Labels
area/v3
relates to / is being considered for v3
kind/feature
describes a code enhancement / feature request
Checklist
What problem does this solve?
Makes it easier for developers to add shell completion to the CLI tools they're building with
urfave/cli/v3
. This would make completion installation the same as the popular Cobra library, that is:myapp completion zsh
prints the completion script forzsh
. The user of the CLI gets to decide what to do with it:. <(myapp completion zsh)
We already have completion scripts in this repository for all major popular shells (
bash
,zsh
,pwsh
), and furthermore, these scripts are already bundled with the module:cli/completion.go
Lines 14 to 16 in 204d34f
Solution description
By default, each CLI app made with
urfave/cli/v3
should have thecompletion
command (hidden by default)I don't think this could be brought into
v2
, because it would break if the developer already defined thecompletion
command.Describe alternatives you've considered
The alternative is the current situation – developers have to copy , which is unnecessary work, given that the completion files are embedded in
urfave/cli
anyway.The text was updated successfully, but these errors were encountered: