summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGregory Pakosz <gregory.pakosz@gmail.com>2019-03-21 09:35:46 +0100
committerDavid Lord <davidism@gmail.com>2020-02-22 13:51:34 -0800
commit91ea0de0ec00a08eb36b138029a401baf51c71b4 (patch)
treeec1038846cf72e3defc64292dd2a348a18bc68ed /docs
parent93d947c2e3c5584729d7de35644f778c0e8e147e (diff)
downloadclick-91ea0de0ec00a08eb36b138029a401baf51c71b4.tar.gz
prevent automatic environment variables from containing dashes
Diffstat (limited to 'docs')
-rw-r--r--docs/options.rst11
1 files changed, 7 insertions, 4 deletions
diff --git a/docs/options.rst b/docs/options.rst
index d7d7356..29000a1 100644
--- a/docs/options.rst
+++ b/docs/options.rst
@@ -593,8 +593,8 @@ environment variables which is supported for options only. To enable this
feature, the ``auto_envvar_prefix`` parameter needs to be passed to the
script that is invoked. Each command and parameter is then added as an
uppercase underscore-separated variable. If you have a subcommand
-called ``foo`` taking an option called ``bar`` and the prefix is
-``MY_TOOL``, then the variable is ``MY_TOOL_FOO_BAR``.
+called ``run`` taking an option called ``reload`` and the prefix is
+``WEB``, then the variable is ``WEB_RUN_RELOAD``.
Example usage:
@@ -615,8 +615,11 @@ And from the command line:
invoke(greet, env={'GREETER_USERNAME': 'john'},
auto_envvar_prefix='GREETER')
-When using ``auto_envvar_prefix`` with command groups, the command name needs
-to be included in the environment variable, between the prefix and the parameter name, *i.e.* *PREFIX_COMMAND_VARIABLE*.
+When using ``auto_envvar_prefix`` with command groups, the command name
+needs to be included in the environment variable, between the prefix and
+the parameter name, *i.e.* ``PREFIX_COMMAND_VARIABLE``. If you have a
+subcommand called ``run-server`` taking an option called ``host`` and
+the prefix is ``WEB``, then the variable is ``WEB_RUN_SERVER_HOST``.
Example: