clap-rs / clap

A full featured, fast Command Line Argument Parser for Rust
docs.rs/clap
Apache License 2.0
13.64k stars 1.02k forks source link

fix(zsh): separate declared options from _arguments options #5522

Closed ben-- closed 3 weeks ago

ben-- commented 3 weeks ago

This PR fixes issue #5521

The zsh _arguments completion function has the following syntax:

_arguments [ARGUMENTS_OPTIONS] [:] COMMAND_ARG...

Where the optional colon is used to disambiguate options consumed by the _arguments function itself.

If this colon is missing and the first COMMAND_ARG conflicts with one of the options supported by _arguments, then it is misinterpreted resulting in missing options or the unknown match specification character seen above.