Skip to content

Customizable error handlingΒ #41

@lud

Description

@lud

Feature request

Hello,

Thank you for this library! I'm building an app with it.

Something I would like is to be able to intercept errors like Error: Unknown flag: --e or Error: Missing required parameter "foo" So we can print them with the same output style used in commands.

Currently there is a console.error that is not customizable, then the usage is printed and the script aborts.

Why?

This is to have a consistent output formatting with errors generated by commands.

Alternatives

I tried to try/catch the cli() call, but so far it seems that there is no possible way to get the parsing errors as a return value instead of exiting the script.

Additional context

No response

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