cli icon indicating copy to clipboard operation
cli copied to clipboard

bug: zsh autocompletions

Open mahyarmirrashed opened this issue 5 months ago • 0 comments

My urfave/cli version is

v3

Checklist

  • [x] Are you running the latest v3 release? The list of releases is here.
  • [x] Did you check the manual for your release? The v3 manual is here
  • [x] Did you perform a search about this problem? Here's the GitHub guide about searching.

Dependency Management

  • My project is using go modules.

Describe the bug

Completions aren't work for ZSH:

mahyar@tiger tmp % ./greet add - --generate-shell-completion
--config:path to config file
--help:show help
mahyar@tiger tmp % ./greet add --conf --generate-shell-completion
help:Shows a list of commands or help for one command

To reproduce

Use the example provided here: https://cli.urfave.org/v3/examples/completions/shell-completions/

Observed behavior

It did not autocomplete properly.

Expected behavior

For it to auto-complete to --config.

Additional context

N/A

Want to fix this yourself?

I've made a simple fix to the generated ZSH completion script that has it working on my system.

Run go version and paste its output here

# paste `go version` output in here

Run go env and paste its output here

# paste `go env` output in here

mahyarmirrashed avatar Jul 26 '25 09:07 mahyarmirrashed