Skip to content

Custom log/error message for Cobra command #2317

@vax-r

Description

@vax-r

Description

In some scenarios, as our project's developer, we would like to keep our own error message style. Cobra does provide a nice interface for easy implementation of command/subcommand , but it lacks the flexibility to let ourselves decide our own log/error message. e.g. the error message forMarkFlagsMutuallyExclusive() is fixed.

I would like to help extend this feature if that's possible, maybe giving a message parameter in these functions and use make original cobra error message as default when nothing is provided will be good ?

I also found #1988 talking about similar things.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions