Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/sphinx
diff options
context:
space:
mode:
authorLuke Lau <luke_lau@icloud.com>2020-06-02 19:56:01 +0300
committerLuke Lau <luke_lau@icloud.com>2020-06-03 18:35:00 +0300
commit1e7d9269e935d8e2e7cf6d962a3179b5f46a7263 (patch)
tree6088474768c4edd1cbcffc3f39a5b8912fecd2fd /sphinx
parent3419079fb0d1f0eecd845eff0d12b367d34cd5e9 (diff)
Let option directive support args in the form of foo[=bar]
This slightly tweaks the regex so that command line flags of the form foo[=N] are properly split up. This is useful for any programs that can take `--foo` as a flag on its own as well as with an extra argument `--foo=12`.
Diffstat (limited to 'sphinx')
-rw-r--r--sphinx/domains/std.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py
index 6dc597022..fbbed3a6b 100644
--- a/sphinx/domains/std.py
+++ b/sphinx/domains/std.py
@@ -43,7 +43,7 @@ logger = logging.getLogger(__name__)
# RE for option descriptions
-option_desc_re = re.compile(r'((?:/|--|-|\+)?[^\s=]+)(=?\s*.*)')
+option_desc_re = re.compile(r'((?:/|--|-|\+)?[^\s=[]+)(=?\s*.*)')
# RE for grammar tokens
token_re = re.compile(r'`(\w+)`', re.U)