Help: Improve abbreviated command-line option roles

Slightly tweak the helper roles that automatically generate targets for
command-line options to also strip values from `--arg <value>` options.
This commit is contained in:
Matthew Woehlke
2026-04-02 16:44:09 -04:00
parent aa6f936d6c
commit b96826bc08

View File

@@ -592,7 +592,7 @@ class CMakeOptionXRefRole(OptionXRefRole):
super().__init__()
def __call__(self, typ, rawtext, text, *args, **kwargs):
content = f'{text} <{self.command} {text.split('=')[0]}>'
content = f'{text} <{self.command} {re.split(r'[ =]', text)[0]}>'
return super().__call__('std:option', text, content, *args, **kwargs)