clap
clap copied to clipboard
fish support for native completions
See #3166 for more context
- code
- tests
- argcomplete and cobra can serve as examples
Tasks
- [x] #5048
- [ ] Identify and resolve gaps with static completions
I wanted to start on this, looking at the current structure with bash, would it make sense to move the bash mod into a separate file, and could/should some of the bash code be reused instead of duplicated, and therefore extracted into a shared module for utils?
I mostly kept it a single file for ease of prototyping. It will make sense to split it into another file. Please do that in a separate commit from other work so its easier to track whats going on
Have the PR setup now for review. Still open things, especially in the handling of more complex functionality in handling parsing errors or arguments taking multiple values.
Also there might be some ways to unify code with claps actual parsing logic, but as I'm not familiar with it, I skipped that for now.
Also there might be some ways to unify code with claps actual parsing logic, but as I'm not familiar with it, I skipped that for now.
Yeah, I hope to find a way to merge it one day but I figure its better for us to learn what is expected first
Yeah, I hope to find a way to merge it one day but I figure its better for us to learn what is expected first
Yeah makes sense. There is probably also a bunch of parsing/error handling that can be skipped for completions.
- [ ] fish integration #5048
- [ ] make globs in paths work with completion:
- complete containing globs:
*/bawould complete to*/bash.rsand*/banana.rs(given the pathsa/bash.rs,a/banana.rs, andb/bash.rsexist) - expand globs
a-*would expand toa-b a-c. - complete substrings (not only prefixes)
rc/he/bawould complete tosrc/shell/bash.rs.
- complete containing globs:
- [ ] only complete options if current argument starts with
-or--#5058 - [ ] show help in completions #5056