Skip to content

bug: zsh autocompletions #2173

@mahyarmirrashed

Description

@mahyarmirrashed

My urfave/cli version is

v3

Checklist

  • Are you running the latest v3 release? The list of releases is here.
  • Did you check the manual for your release? The v3 manual is here
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/v3relates to / is being considered for v3kind/bugdescribes or fixes a bugstatus/triagemaintainers still need to look into this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions