mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
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`.
This commit is contained in:
parent
3419079fb0
commit
1e7d9269e9
@ -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)
|
||||
|
||||
|
@ -180,7 +180,9 @@ Others
|
||||
|
||||
.. option:: arg
|
||||
|
||||
Link to :option:`perl +p`, :option:`--ObjC++`, :option:`--plugin.option`, :option:`create-auth-token` and :option:`arg`
|
||||
.. option:: -j[=N]
|
||||
|
||||
Link to :option:`perl +p`, :option:`--ObjC++`, :option:`--plugin.option`, :option:`create-auth-token`, :option:`arg` and :option:`-j`
|
||||
|
||||
.. program:: hg
|
||||
|
||||
|
@ -331,6 +331,8 @@ def test_html4_output(app, status, warning):
|
||||
'create-auth-token'),
|
||||
(".//a[@class='reference internal'][@href='#cmdoption-perl-arg-arg']/code/span",
|
||||
'arg'),
|
||||
(".//a[@class='reference internal'][@href='#cmdoption-perl-j']/code/span",
|
||||
'-j'),
|
||||
(".//a[@class='reference internal'][@href='#cmdoption-hg-arg-commit']/code/span",
|
||||
'hg'),
|
||||
(".//a[@class='reference internal'][@href='#cmdoption-hg-arg-commit']/code/span",
|
||||
|
Loading…
Reference in New Issue
Block a user