Skip to content

proposal: flag: add SetHelpOutput to specify the destination for help explicitly #41523

@Songmu

Description

@Songmu

I was pleased to see the exit code set to 0 when -h/--help was explicitly specified with Go 1.15 or later. ref. #37533.

I have one more request for -h/--help. It is that I want to be able to output usage to Stdout instead of Stderr only when the help flag is explicitly specified. This is useful when we want to pipe the output to a pager such as less.

I've made the following changes to allow us to specify the output destination for help. How about it?

cbb8882

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions