Skip to content

Option with default value does not have Action added to PreActions #2621

@barrygiles

Description

@barrygiles

Say there is an QuietOption which is a boolean and has some action associated with it.

If --quiet is specified on the command line, the associated action gets added to the PreAction list and is executed before the main command action.

If --quiet is not specified on the command line, but instead it is given a default value - say driven from configuration - then the associated action is not added to the PreAction list and is not executed.

As far as the parse result is concerned, both of these look the same and so should function the same, i.e. the --quiet option has been supplied somehow and action should happen accordingly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions