Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Seeing this got me curious to know if any work has been done on generating completions for applications that make use of the clap command-line argument parser.

https://github.com/clap-rs/clap

https://crates.io/crates/clap

Among other things I found this currently open issue that has a lot of discussion and information in it:

https://github.com/clap-rs/clap/issues/568

It might be of interest to you as well, OP?



I did come across this work by clap while doing research for this post. The major difference in strategy is that clap is generating completion scripts in Bash, while shell_completion is a library which helps writing completion scripts in Rust. I think one exciting bit of future potential for shell_completion is it could potentially allow building something like what clap has done using the standard Rust macro system.

In any event, thanks for bringing this up.


I actually wrote a library that generates completions for both zsh and bash for the Ruby Thor CLI library. https://github.com/snowe2010/fylla/

This could be useful in research to make it work for clap.

I wrote two articles that kind of highlight the differences in completions between the two, but only in regards to subcommands, since that's what I was trying to cover.

https://tylerthrailkill.com/2019-01-19/writing-bash-completi... https://tylerthrailkill.com/2019-01-13/writing-zsh-completio...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: