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: print usage before error when argument parsing causes an error #5034

Merged

Conversation

jan--f
Copy link
Contributor

@jan--f jan--f commented Jan 6, 2022

This intends to improve error reporting in k8s. Before this change
thanos would print the error, followed by the usage. The latter part
would fill up a container status message (in say kubectl describe)
with the usage, hiding the actual error.

Signed-off-by: Jan Fajerski jfajersk@redhat.com

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Verification

This intends to improve error reporting in k8s. Before this change
thanos would print the error, followed by the usage. The latter part
would fill up a container status message (in say `kubectl describe`)
with the usage, hiding the actual error.

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
@jan--f
Copy link
Contributor Author

jan--f commented Jan 6, 2022

I'm sure there is a better solution for this, I went with the smallest change to see what the maintainers think.

@GiedriusS
Copy link
Member

I think this makes sense and it's a nice usability improvement. 👍

Copy link
Member

@squat squat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@squat squat enabled auto-merge (squash) January 6, 2022 14:53
@GiedriusS GiedriusS disabled auto-merge January 6, 2022 15:05
@GiedriusS GiedriusS merged commit e03452e into thanos-io:main Jan 6, 2022
@GiedriusS
Copy link
Member

Documentation check seems broken :(

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

Successfully merging this pull request may close these issues.

3 participants