Skip to content

Explicitly return when an error occurs #443

@plemarquand

Description

@plemarquand

Methods that rely on error methods (such as unknownOption, missingArgument, etc...) use process.exit() to stop execution and exit the program. This is quite inconvenient if you want to use Commander in a context other than a shell.

If a client extends the Command prototype to avoid having these error methods call process.exit(), command execution continues and commander blows up.

Personally I am using commander to parse arguments for my Slack bot, extending Command to prevent process.exit()s but even still if you input an incorrect command the program will crash.

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