diff options
author | Brendan O'Dea <bod@debian.org> | 2020-03-15 22:06:42 +1100 |
---|---|---|
committer | Brendan O'Dea <bod@debian.org> | 2020-03-15 22:06:42 +1100 |
commit | 611b98db2ec993fab6fd957fca62beee3b803520 (patch) | |
tree | 6b84c0c63836b16be4d55a3c4f763bae51ca4639 /help2man.PL | |
parent | f284bd0d3bcb2893b0e8f5575140f8b0655fe16c (diff) | |
download | help2man-611b98db2ec993fab6fd957fca62beee3b803520.tar.gz |
Update parsing of --version to allow multi-word programs
Diffstat (limited to 'help2man.PL')
-rwxr-xr-x | help2man.PL | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/help2man.PL b/help2man.PL index 2fee2bf..ba0864c 100755 --- a/help2man.PL +++ b/help2man.PL @@ -409,14 +409,14 @@ if ($opt_output) ($_, $version_text) = ((split /\n+/, $version_text, 2), ''); -if (/^(\S+) +\(((?:GNU|Free) +[^)]+)\) +(.*)/ or - /^(\S+) +- *((?:GNU|Free) +\S+) +(.*)/) +if (/^(\S+) +\(((?:GNU|Free) +[^)]+)\) +(\S+)$/ or + /^(\S+) +- *((?:GNU|Free) +\S.*) +(\S+)$/) { $program = program_basename $1; $package = $2; $version = $3; } -elsif (/^((?:GNU|Free) +)?(\S+) +(.*)/) +elsif (/^((?:GNU|Free) +)?(\S.*) +(\S+)$/) { $program = program_basename $2; $package = $1 ? "$1$program" : $program; |