Skip to content

Differentiate defaults from explicitly passed values #1264

@ulope

Description

@ulope

Unless I've missed something it seems there is currently no way to differentiate between an explicitly passed value and a default value.

This is problematic for establishing value precedence when dealing with other sources of parameter values (a config file in our case).
We're currently using the default values to detect if a given option was passed on the command line but this is imperfect and leads to the following problem:

  • @option('--some-option', default=1)
  • Some other way of specifying option values (e.g. a config file) sets some-option = 2
  • User calls cli with --some-option 1

Under the above workaround this makes it appear as if the config file value (2) should have precedence even though the user explicitly requested value 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions