Skip to content

Raise click.BadParameter if config contains unknown keys#35

Open
sphuber wants to merge 1 commit into
phha:masterfrom
sphuber:fix/11/raise-on-unknown-keys
Open

Raise click.BadParameter if config contains unknown keys#35
sphuber wants to merge 1 commit into
phha:masterfrom
sphuber:fix/11/raise-on-unknown-keys

Conversation

@sphuber
Copy link
Copy Markdown

@sphuber sphuber commented Mar 22, 2023

Fixes #11

Before, any keys in the configuration file that did not match any parameters of the command would be silently ignored. This could lead to confusion with users if they accidentally mistyped a parameter in the configuration file.

Here, the configuration_callback method is updated to cross-reference the keys in the configuration file with the names of the command's parameters. If any keys are not recognized a click.BadParameter is raised indicating the unrecognized keys.

Before, any keys in the configuration file that did not match any
parameters of the command would be silently ignored. This could lead to
confusion with users if they accidentally mistyped a parameter in the
configuration file.

Here, the `configuration_callback` method is updated to cross-reference
the keys in the configuration file with the names of the command's
parameters. If any keys are not recognized a `click.BadParameter` is
raised indicating the unrecognized keys.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

warn when providing unsupported options in the config file?

1 participant