Open sotcsa opened 3 years ago
Yes please! I've wanted this for a while. I even naturally press TAB sometimes while typing solana ...
and make myself sad.
Add another +1! The clap
crate can allegedly do this for us, but I don't think anyone has been bothered enough to check it out. https://docs.rs/clap/2.33.3/clap/struct.App.html#method.gen_completions
solana-cli can now generate a shell completion script, but I've left this issue open because we still lack docs about how to enable. Maybe something like this? https://github.com/rust-lang/rustup/blob/master/doc/src/installation/index.md#enable-tab-completion-for-bash-fish-zsh-or-powershell
Great job!
Could you add to the docs how to use it? E.g.
solana completion > bin/solana_completion.sh
source bin/solana_completion.sh
How to do with Zsh: https://quan.hoabinh.vn/blog/2022/10/104-enable-auto-completion-for-solana-cli
Problem
Linux based solana command-line tool has no bash-autocomplete script, it would be perfect and easy to use on Linux (even on Mac)
Proposed Solution
Implement solana-completion.bash, add to README how to set it up.
source ./solana-completion.bash
Examples: Docker: https://raw.githubusercontent.com/docker/docker-ce/master/components/cli/contrib/completion/bash/docker docker-compose: https://docs.docker.com/compose/completion/
Article on how to implement (with other useful links): https://iridakos.com/programming/2018/03/01/bash-programmable-completion-tutorial
I am volunteering if nobody else is interestid