diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2018-09-08 16:56:08 -0400 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2018-09-08 20:12:20 -0400 |
| commit | 69d106fec5ac2e9aba1146c0004d961e8cb903f5 (patch) | |
| tree | 25e385c4ed07dcf0b7d73e6c81bedc939b916baf /doc | |
| parent | c001d1676de46aef12f80a21675937756e594acf (diff) | |
| download | python-coveragepy-git-69d106fec5ac2e9aba1146c0004d961e8cb903f5.tar.gz | |
Defaultable variable substitution
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/config.rst | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/doc/config.rst b/doc/config.rst index ab874619..666a1321 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -59,10 +59,17 @@ or ``0`` and are case-insensitive. Environment variables can be substituted in by using dollar signs: ``$WORD`` or ``${WORD}`` will be replaced with the value of ``WORD`` in the environment. -A dollar sign can be inserted with ``$$``. If you want to raise an error if -an environment variable is undefined, use a question mark suffix: ``${WORD?}``. -Otherwise, missing environment variables will result in empty strings with no -error. +A dollar sign can be inserted with ``$$``. Special forms can be used to +control what happens if the variable isn't defined in the environment: + +- If you want to raise an error if an environment variable is undefined, use a + question mark suffix: ``${WORD?}``. + +- If you want to provide a default for missing variables, use a dash with a + default value: ``${WORD-default value}``. + +- Otherwise, missing environment variables will result in empty strings with no + error. Many sections and values correspond roughly to commands and options in the :ref:`command-line interface <cmd>`. |
