ARGV: extract #values from missing
This commit is contained in:
parent
a4dc835ba0
commit
c4c855b9fc
@ -18,10 +18,8 @@ module Homebrew
|
||||
ARGV.resolved_formulae
|
||||
end
|
||||
|
||||
hide = (ARGV.value("hide") || "").split(",")
|
||||
|
||||
ff.each do |f|
|
||||
missing = f.missing_dependencies(hide: hide)
|
||||
missing = f.missing_dependencies(hide: ARGV.values("hide"))
|
||||
next if missing.empty?
|
||||
|
||||
print "#{f}: " if ff.size > 1
|
||||
|
||||
@ -121,6 +121,13 @@ module HomebrewArgvExtension
|
||||
flag_with_value.strip_prefix(arg_prefix) if flag_with_value
|
||||
end
|
||||
|
||||
# Returns an array of values that were given as a comma-seperated list.
|
||||
# @see value
|
||||
def values(name)
|
||||
return unless val = value(name)
|
||||
val.split(",")
|
||||
end
|
||||
|
||||
def force?
|
||||
flag? "--force"
|
||||
end
|
||||
|
||||
@ -62,4 +62,19 @@ class ArgvExtensionTests < Homebrew::TestCase
|
||||
assert !@argv.flag?("--frotz")
|
||||
assert !@argv.flag?("--debug")
|
||||
end
|
||||
|
||||
def test_value
|
||||
@argv << "--foo=" << "--bar=ab"
|
||||
assert_equal "", @argv.value("foo")
|
||||
assert_equal "ab", @argv.value("bar")
|
||||
assert_nil @argv.value("baz")
|
||||
end
|
||||
|
||||
def test_values
|
||||
@argv << "--foo=" << "--bar=a" << "--baz=b,c"
|
||||
assert_equal [], @argv.values("foo")
|
||||
assert_equal ["a"], @argv.values("bar")
|
||||
assert_equal ["b", "c"], @argv.values("baz")
|
||||
assert_nil @argv.values("qux")
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user