-
Notifications
You must be signed in to change notification settings - Fork 88
feat: add completions subcommand #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 21858546890Details
💛 - Coveralls |
AmosOO7
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @va-an , nice work on this. I tested and it worked fine on my end.
I left a comment on some part in the command.rs file that I think should be moved to the README.md file.
Also I had to create the folders bash-completion, and completions in ~/.local/share I don't know if this is peculiar to my case, but maybe it is something you can add in the readme file also to mkdir this folders so the command bdk-cli completions bash > ~/.local/share/bash-completion/completions/bdk-cli runs smoothly and for any other commands that might need it.
src/commands.rs
Outdated
| /// Bash: | ||
| /// bdk-cli completions bash > ~/.local/share/bash-completion/completions/bdk-cli | ||
| /// | ||
| /// Zsh: | ||
| /// bdk-cli completions zsh > ~/.zfunc/_bdk-cli | ||
| /// # Make sure ~/.zfunc is in your fpath (add to .zshrc): | ||
| /// # fpath=(~/.zfunc $fpath) | ||
| /// # autoload -Uz compinit && compinit | ||
| /// | ||
| /// Fish: | ||
| /// bdk-cli completions fish > ~/.config/fish/completions/bdk-cli.fish | ||
| /// | ||
| /// PowerShell: | ||
| /// bdk-cli completions powershell >> $PROFILE | ||
| /// | ||
| /// Elvish: | ||
| /// bdk-cli completions elvish >> ~/.elvish/rc.elv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this part should be moved to the README.md file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for displaying the bdk-cli completions --help command. I made this by analogy with rustup completions --help.
I suggest keeping the detailed instructions for setting up completions in bdk-cli completions --help, since this relates only to a specific command, not to the entire program as a whole.
But I think it would be useful to mention the new completions command in the README, as this will significantly simplify users' interaction with bdk-cli.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added new block about completions to README.
Thank you for catching this! |
Description
Resolves #234.
Added
completionssubcommand to generate shell completions.How to test
Install bdk-cli:
cargo install --path . --all-featuresSee how to install completions for your shell:
For example, to install completions for zsh:
After restarting the shell, completions should work with Tab.
Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features:
CHANGELOG.md