Skip to content

Option directive (std domain) does not recognize options with conjoined values #14323

@mwoehlke-kitware

Description

@mwoehlke-kitware

Describe the bug

The std domain parser recognizes options with values like --long <value> and --long=<value>, but does not recognize short options with conjoined values like -S<value>.

Should option_desc_re be tweaked to "recognize" these?

The current regex is ((?:/|--|-|\+)?[^\s=]+)(=?\s*.*). Adding < to the set of characters not allowed in an option name (i.e. ((?:/|--|-|\+)?[^\s=<]+)(=?\s*.*)) allows a conjoined <value> to be recognized as not part of the option name.

How to Reproduce

.. option:: -S<value>

  Describe option here.

Environment Information

Platform:              linux; (Linux-6.16.10-200.fc42.x86_64-x86_64-with-glibc2.41)
Python version:        3.13.11 (main, Jan  6 2026, 00:00:00) [GCC 15.2.1 20251211 (Red Hat 15.2.1-5)])
Python implementation: CPython
Sphinx version:        8.1.3
Docutils version:      0.21.2
Jinja2 version:        3.1.6
Pygments version:      2.18.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions