hayagriva icon indicating copy to clipboard operation
hayagriva copied to clipboard

[feature] Shell completions

Open Freed-Wu opened this issue 2 years ago • 1 comments

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!

Freed-Wu avatar Apr 05 '23 07:04 Freed-Wu

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.

BoostCookie avatar Jul 04 '24 11:07 BoostCookie