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

Add support for completing `--flag value<TAB>`, `-fbar<TAB>`, `-f=bar<TAB>` and `-f bar<TAB>` #5533

Closed shannmu closed 3 days ago

shannmu commented 2 weeks ago

Related issues:

In this PR, I modified some logic in the complete function:

There are some TODOs in this PR that I will implement later, including:

shannmu commented 2 weeks ago

The current code hasn't been tested a lot. I've just done some quick tests using the dynamic program from the tests. Also, for the CI, I'll rebase onto clap's master branch later and modify the commit message and a few other things to meet the CI requirements.

shannmu commented 2 weeks ago

I need to split this PR into smaller PRs for easier discussion and review. How should I handle the situation where one resulting PR might be based on another PR?

epage commented 1 week ago

I need to split this PR into smaller PRs for easier discussion and review. How should I handle the situation where one resulting PR might be based on another PR?

Either hold off on the follow up PRs or put them up, note the dependency, and rebase once the other PR is merged.