Skip to content

Conversation

@teal-bauer
Copy link

Summary

  • Print CLI error messages to stderr before exiting with error code

Previously, when app.Run() returned an error (e.g., asdf set -h foo 1.2.3), the CLI would exit with code 1 but print nothing, making it difficult to understand what went wrong.

Now the error message is printed (e.g., "No help topic for 'foo'").

Test plan

  • Verify asdf set -h foo 1.2.3 now prints error message
  • Verify asdf set -h still shows help with exit code 0
  • Verify normal asdf set <tool> <version> still works
  • Run existing CLI tests (go test ./internal/cli/...)

@teal-bauer teal-bauer requested a review from a team as a code owner January 5, 2026 13:27
@teal-bauer
Copy link
Author

I cannot count the number of times I have accidentally run asdf set -h foo 1.2.3 for home directory, where it would not show ANY error output, and then wonder why things didn't work, until at some point I remember to use -u instead. But I also always run asdf set --help, think "huh, but -h should've shown help but didn't, so maybe the -h did work...?"...

@teal-bauer teal-bauer changed the title fix(cli): print error message when app.Run fails fix(golang-rewrite): print error message when app.Run fails Jan 5, 2026
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