man: parse short and long options in shell commands
Add a regex to handle two comma-separated options on the same line in command help strings.
This commit is contained in:
parent
db42dd0420
commit
a4c8fc74f7
@ -195,7 +195,9 @@ module Homebrew
|
||||
line = line.slice(4..-1)
|
||||
next unless line
|
||||
|
||||
lines << line.gsub(/^ +(-+[a-z-]+) */, "* `\\1`:\n ")
|
||||
# Format one option or a comma-separated pair of short and long options.
|
||||
lines << line.gsub(/^ +(-+[a-z-]+), (-+[a-z-]+) +/, "* `\\1`, `\\2`:\n ")
|
||||
.gsub(/^ +(-+[a-z-]+) +/, "* `\\1`:\n ")
|
||||
end
|
||||
lines
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user