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

Change: Updates the output from an Error to Stderr when listing variables where none are set #298

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

CGoodwin90
Copy link
Contributor

@CGoodwin90 CGoodwin90 commented Oct 27, 2023

Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated.
  • Changelog entry has been written

When running list variables on a project/environment where none exist an error is returned alongside the cli Usage text. Rather than returning an error, this updates the cmd to output the message via Stderr with an empty table (similar functionality to how the api currently operates) and doesn't unnecessarily display the Usage text. Also updates the output package to handle the error strings.

Closes #296

pkg/output/main.go Outdated Show resolved Hide resolved
@CGoodwin90 CGoodwin90 changed the title Change: Updates the output from an Error to Stdout when listing variables where none are set Change: Updates the output from an Error to Stderr when listing variables where none are set Oct 27, 2023
@CGoodwin90 CGoodwin90 marked this pull request as ready for review October 30, 2023 01:28
@shreddedbacon
Copy link
Member

Sweet, minor quality of life improvement. Might be worth checking other things that return errors and handling them in a similar fashion

@shreddedbacon shreddedbacon merged commit f5b467e into main Oct 30, 2023
4 checks passed
@shreddedbacon shreddedbacon deleted the update_cmd_output branch October 30, 2023 02:36
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.

Valid command producing an error shows usage string unnecessarily when using "list variables"
2 participants