feat(cli): add completion generation support for nushell - #838
Conversation
d93de3b to
8909dba
Compare
|
Hey @jcgruenhage, thanks for opening a PR!
Cool, thank you!
All things being equal, I'd prefer to defer this until there's a end-user request for it -- that keeps things simpler for me in terms of dependency review. Does that work for you? For the rest: I'll do a review now 🙂 |
8909dba to
1462bad
Compare
|
I've removed I've also addressed the rest of your review comments, thanks for the feedback :) |
|
Thanks a ton @jcgruenhage, this looks great to me! Two small logistical things:
Other than those, I think this is good to go! Edit: I've run the CI preliminarily, but I expect it'll fail on the above |
1462bad to
dfbcd9b
Compare
dfbcd9b to
a98e520
Compare
Co-authored-by: William Woodruff <william@yossarian.net>
|
BTW, don't worry about force-pushing -- I use a squash-merge workflow so having the commit history here is fine. |
Signed-off-by: William Woodruff <william@yossarian.net>
|
Thanks a ton @jcgruenhage! |
I'm packaging zizmor for Chimera Linux right now (see chimera-linux/cports#4255), and Chimera Linux is shipping nushell completions where available. As a nushell user, I'd love to see nushell completions for zizmor in addition to the ones already provided. While I was at it, I also added carapace, which is a multi-shell completion engine.
The way I'm doing it here is not great, because it requires replicating
clap_complete::Shelland extending it to support the additional shells. An alternative that requires less code on the zizmor side is to use something likeclap_allgen, but that is not intended to be used with aShellenum, it's intended use is to generate all completions with one function call. Going for that would be a breaking change of the CLI interface, which I'd assume would need to wait for a v2, if it's wanted at all?A completely different alternative I'd like to bring up is generating completions during build time using a
build.rsfile. This would allow cross compiling zizmor and still shipping completion packages without resorting to emulation or compiling twice. That requires bigger changes though, so didn't want to spend time on this without discussing it first.