Skip to content
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

CLI auto-completions #1789

Merged
merged 4 commits into from
Jan 19, 2022
Merged

CLI auto-completions #1789

merged 4 commits into from
Jan 19, 2022

Conversation

mzabaluev
Copy link
Contributor

@mzabaluev mzabaluev commented Jan 18, 2022

Closes: #1096

Description

Add a completions command using the functionality of clap_complete to generate completion scripts for various shells.


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests: integration (for Hermes) or unit/mock tests (for modules).
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

In the commands module, declare submodules first, then
imports of the names from the submodules, then imports
for the module code itself.
@mzabaluev mzabaluev added O: new-feature Objective: cause to add a new feature or support I: CLI Internal: related to the relayer's CLI labels Jan 18, 2022
@mzabaluev
Copy link
Contributor Author

Thanks @rnbguy for providing a code example and the timely release of modelator to enable a clap upgrade!

@mzabaluev mzabaluev marked this pull request as ready for review January 18, 2022 13:59
@mzabaluev
Copy link
Contributor Author

I have tested that it works with bash.

@romac
Copy link
Member

romac commented Jan 19, 2022

Couldn't make it work with zsh but that's likely an issue with my setup (my dotfiles are a mess). In any case, this mostly piggy backs on clap so we should be good to go.

@rnbguy
Copy link
Member

rnbguy commented Jan 19, 2022

@romac where are you putting the generated completions scripts for zsh?

@mzabaluev mzabaluev merged commit 268c372 into master Jan 19, 2022
@mzabaluev mzabaluev deleted the mikhail/cli-completions branch January 19, 2022 20:29
@adizere adizere mentioned this pull request Jan 21, 2022
5 tasks
@romac romac mentioned this pull request Jan 26, 2022
5 tasks
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
cli: Add completions command using clap_complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: CLI Internal: related to the relayer's CLI O: new-feature Objective: cause to add a new feature or support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI auto-complete support
4 participants