typst / hayagriva

Rusty bibliography management.
Apache License 2.0
290 stars 44 forks source link

[feature] Shell completions #41

Open Freed-Wu opened 1 year ago

Freed-Wu commented 1 year ago

Same as https://github.com/typst/typst/issues/545:

Can it provide completions for common shells? I guess https://docs.rs/clap_complete/latest/clap_complete can be helpful. TIA!

BoostCookie commented 1 week ago

I would love to work on this, but I don't know how to solve one specific problem. rustup and juliaup have a completions command that creates the shell completions. For example rustup completions zsh prints out the completions script for zsh. This can be saved to some file like ~/.zfunc/rustup which gets sourced by zsh and then the shell completions are available.

Now here is the problem Usage: hayagriva [OPTIONS] <INPUT> [COMMAND] Why is <INPUT> before [COMMAND]? This makes it impossible/awkward to add another command like completions which does not require any input file.