hayagriva
hayagriva copied to clipboard
[feature] Shell completions
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!
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.