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

feat(clap_complete): Support flags with values in native completions #5539

Open shannmu opened 1 week ago

shannmu commented 1 week ago

Closes https://github.com/clap-rs/clap/issues/3920

shannmu commented 2 days ago

The cases of -fbar and -f=bar have not been handled yet.

shannmu commented 2 days ago

I have added support for -fbar and -f=bar completion. https://github.com/clap-rs/clap/blob/469d847d35731a987235d320517700c07ba729a4/clap_complete/src/dynamic/completer.rs#L141-L146 This code didn't consider the case -f=bar[TAB], so it could generate -f=barf in completions. I will fix it later.