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

Add command completion #589

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nimrod-a
Copy link

Add command completion #410

  • Adds shell completion scripts for Bash and Zsh
  • Adds documentation on activating command completion and on generating shell completions locally

For reference: Click Docs

Testing

For testing, you would need to either generate your own shell completion scripts or download the ones in this commit.
The Curl command in the docs would not work yet as the files are not available in the repo.

Note

As an alternative to providing the user with pre-generated shell completion scripts, one ca add the following to ~/.bashrc / ~/.zshrc, which would result in generating the shell completion scripts every time a shell is started:

eval "$(__MVT_IOS_COMPLETE=bash_source mvt-ios)" # Example for mvt-ios in bash

However, this does not work properly for MVT in a virtual env, as the mvt commands are only available once the env is activated, not upon opening the shell. It would then result in an error:

bash: mvt-ios: command not found

We could consider adding the eval instructions for users who installed MVT system-wide.

@nimrod-a nimrod-a changed the title Feature/command completion Add command completion Dec 22, 2024
@nimrod-a
Copy link
Author

nimrod-a commented Dec 23, 2024

@besendorf and I discussed that it may make more sense to source the command completion files automatically. New users benefit from command completion the most, so it would be more useful if the user would not need extra steps for activating it.
Any idea how we could run the following automatically in pip/docker post-install?

 . .mvt-android-complete.bash && . .mvt-ios-complete.bash # bash 
 . .mvt-android-complete.zsh && . .mvt-ios-complete.zsh # zsh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant