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 new CLI command to simplify shell completion #8413
Conversation
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 looks like a really nice quality of life improvement! i wonder whether we should maybe group certain commands into utility categories, such as localstack cfg
localstack cfg-cli
localstack cli
or something of sorts, to keep the list of top-level commands short and make sure they focus on the core functionality.
WDYT? /cc @SimonWallner
That's a good point... There is already the
Do you think there are going to be other commands which would semantically belong to this command? |
2314b7f
to
628511a
Compare
628511a
to
5c35884
Compare
FYI: The failing Community Integration Tests against Pro are addressed in #8426. But these tests should not be affected by the changes in this PR. |
5c35884
to
af6e2a6
Compare
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.
nice! since it seems industry practice, let's do it 👍
This PR adds a new shell command to support the configuration of auto-completion for the LocalStack CLI.
It uses the Click-feature for Shell completion: https://click.palletsprojects.com/en/8.1.x/shell-completion/
Unfortunately, the configuration is a bit cumbersome:
This is where the new
completion
command comes in. It basically just simplifies printing the shell completion code for a given shell. This completion code can then - depending on the shell - be used to configure the shell completion.By implementing a specific command, it's also easy to ship an extensive documentation explaining the feature (as you can see in the code).
When starting to work on this, I used click-contrib/click-completion for a first PoC. It would even have an install command and powershell support, but I decided against it because:
Jinja2
as an install dependency.