Both `--option::` and `command::` should be backtick-quoted with the new
synopsis style. Remove the requirement for a leading `-` from the regex
which scans for these patterns.
Avoid matching lines like `linkgit:git-diff[1]::` by replacing `.*` with
`[^:]*` in the regex.
Signed-off-by: Todd Zullinger <redacted>
---
Documentation/lint-documentation-style.perl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/lint-documentation-style.perl b/Documentation/lint-documentation-style.perl
index d7ab732293..6eece11bdc 100755
--- a/Documentation/lint-documentation-style.perl
+++ b/Documentation/lint-documentation-style.perl
@@ -24,8 +24,8 @@ sub report {
if ($line =~ /^\[synopsis\]$/) {
$synopsis_style = 1;
}
- if (($line =~ /^(-[-a-z].*|<[-a-z0-9]+>(\.{3})?)(::|;;)$/) && ($synopsis_style)) {
- report($line, "synopsis style and definition list item not backquoted");
+ if (($line =~ /^([-a-z][^:]*|<[-a-z0-9]+>(\.{3})?)(::|;;)$/) && ($synopsis_style)) {
+ report($line, "synopsis style and definition list item not backquoted");
}
}
--
2.56.0.rc0