cli/parser: depopulate commands' args lists
This commit is contained in:
parent
eef9f84a80
commit
d3959727d6
@ -515,8 +515,8 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def disable_switch(*names)
|
def disable_switch(*args)
|
||||||
names.each do |name|
|
args.each do |name|
|
||||||
@args["#{option_to_name(name)}?"] = if name.start_with?("--[no-]")
|
@args["#{option_to_name(name)}?"] = if name.start_with?("--[no-]")
|
||||||
nil
|
nil
|
||||||
else
|
else
|
||||||
@ -614,6 +614,7 @@ module Homebrew
|
|||||||
@processed_options.reject! { |existing| existing.second == option.long.first } if option.long.first.present?
|
@processed_options.reject! { |existing| existing.second == option.long.first } if option.long.first.present?
|
||||||
@processed_options << [option.short.first, option.long.first, option.arg, option.desc.first, hidden]
|
@processed_options << [option.short.first, option.long.first, option.arg, option.desc.first, hidden]
|
||||||
|
|
||||||
|
args.select! { |a| a.start_with?("-") }
|
||||||
if type == :switch
|
if type == :switch
|
||||||
disable_switch(*args)
|
disable_switch(*args)
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user