man.rb: avoid showing comma when an option has no long version.
Specifically, `brew ruby -e "<ruby code>"`.
This commit is contained in:
parent
63b3d400e0
commit
7fb425a5c6
@ -223,15 +223,16 @@ module Homebrew
|
||||
end
|
||||
|
||||
def generate_option_doc(short, long, desc)
|
||||
"* #{format_short_opt(short)}#{format_long_opt(long)}:" + "\n " + desc + "\n"
|
||||
comma = (short && long) ? ", " : ""
|
||||
"* #{format_short_opt(short)}" + comma + "#{format_long_opt(long)}:" + "\n " + desc + "\n"
|
||||
end
|
||||
|
||||
def format_short_opt(opt)
|
||||
"`#{opt}`, " unless opt.nil?
|
||||
"`#{opt}`" unless opt.nil?
|
||||
end
|
||||
|
||||
def format_long_opt(opt)
|
||||
"`#{opt}`"
|
||||
"`#{opt}`" unless opt.nil?
|
||||
end
|
||||
|
||||
def format_usage_banner(usage_banner)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user