Skip to content

fix: suppress help output on runtime errors#41

Merged
boneskull merged 1 commit intomainfrom
fix-35
Feb 14, 2026
Merged

fix: suppress help output on runtime errors#41
boneskull merged 1 commit intomainfrom
fix-35

Conversation

@boneskull
Copy link
Owner

Cobra prints usage/help text by default when RunE returns an error. This meant any runtime error (e.g. a rebase conflict during restack) would dump a wall of irrelevant help output before the actual error message. Set SilenceUsage: true on the root command so help is only shown for actual usage errors.

Closes #35

Cobra prints usage/help text by default when `RunE` returns an error.
This meant any runtime error (e.g. a rebase conflict during `restack`)
would dump a wall of irrelevant help output before the actual error
message. Set `SilenceUsage: true` on the root command so help is only
shown for actual usage errors.

Closes #35
@boneskull
Copy link
Owner Author

📚 Pull Request Stack


Managed by gh-stack

Copilot AI review requested due to automatic review settings February 14, 2026 00:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Cobra root command configuration to avoid printing usage/help text when commands fail at runtime, addressing issue #35 where conflict/runtime errors were preceded by irrelevant help output.

Changes:

  • Sets SilenceUsage: true on the root Cobra command.
  • Adds an explanatory comment describing why usage output is being suppressed on errors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@boneskull boneskull merged commit 07f807b into main Feb 14, 2026
14 checks passed
@boneskull boneskull deleted the fix-35 branch February 14, 2026 00:57
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.

help being shown during restack conflicts

2 participants