Skip to content
Myr

add example of default_map with top level option

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Markus Rossi · committed by David Lord · parent 278a054 · Browse files · 1 file+12 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+12 added−4 removed

  • other:+12 added−4 removed

1 file+12 added−4 removed

modified:docs/commands.rst+12 added-4 removed
438 unmodified lines
439440This is useful if you plug in some commands from another package but441you're not satisfied with the defaults.442443The default map can be nested arbitrarily for each subcommand and444provided when the script is invoked. Alternatively, it can also be445overridden at any point by commands. For instance, a top-level command could446load the defaults from a configuration file.443The default map can be nested arbitrarily for each subcommand:444445.. code-block:: python446447 default_map = {448 "debug": True, # default for a top level option449 "runserver": {"port": 5000} # default for a subcommand450 }451452The default map can be provided when the script is invoked, or453overridden at any point by commands. For instance, a top-level command454could load the defaults from a configuration file.455456Example usage:457458.. click:example::459
112 unmodified lines