Skip to content

fix: style 'unknown help topic' errors - #99

Open
c-tonneslan wants to merge 1 commit into
charmbracelet:mainfrom
c-tonneslan:fix/style-unknown-help-topic
Open

fix: style 'unknown help topic' errors#99
c-tonneslan wants to merge 1 commit into
charmbracelet:mainfrom
c-tonneslan:fix/style-unknown-help-topic

Conversation

@c-tonneslan

Copy link
Copy Markdown

Cobra's default help command prints "Unknown help topic" straight to stdout and returns nil, so fang's ErrorHandler never sees it and the message lands unstyled. This swaps in a help command whose RunE returns an error for unknown topics, so the configured error handler picks it up like any other usage error.

The golden update for with_command_groups/help is the same dedupe of triplicated COMMANDS sections that #97 also makes. If #97 lands first I'll rebase.

Closes #61.

Cobra's default help command prints 'Unknown help topic' to stdout and
returns nil, so fang's ErrorHandler never sees it. Swap in a help
command whose RunE returns an error in that case so the styled handler
runs.

Closes charmbracelet#61.

Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
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.

Styling missing for "unknown help topic" errors

1 participant