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

fix(cli): Avoid printing the cli help text during shell completion #2049

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

Conversation

garbelini
Copy link

What this PR does / why we need it:

Autocomplete is handled by kongplete and due to a workaround in the code to avoid errors when terramate --version coupled with defaulting to adding --help to the arguments if they are empty we end up on a state where the help will always be printed during autocomplete.

To avoid coming up with yet another workaround or changing the current behavior of printing help on argument parsing errors, I felt the best option would be to exit as soon as the completion is done.

Which issue(s) this PR fixes:

Fixes #1739

Special notes for your reviewer:

I couldn't find a good location for tests or even if it would be necessary in this case. Just let me know if needed and I can see if I can find a way to test this.

Does this PR introduce a user-facing change?

no

@i4ki
Copy link
Contributor

i4ki commented Feb 18, 2025

Hi @garbelini

Thanks for the contribution!

We are going to automate the CLA (Contributor License Agreement) process and get back to you in a few days. Sorry for the delay.

@garbelini
Copy link
Author

@i4ki That's great. Thanks for the update.

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.

[BUG] terramate install-completions on fish tries to complete with descriptions and whitespace
2 participants