From 1e7d9269e935d8e2e7cf6d962a3179b5f46a7263 Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Tue, 2 Jun 2020 17:56:01 +0100 Subject: 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`. --- sphinx/domains/std.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sphinx') 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) -- cgit v1.2.3