add ARGV.value

This commit is contained in:
Adam Vandenberg 2013-07-07 09:14:10 -07:00
parent 702b5e5ba2
commit d8d6b254f7

View File

@ -67,6 +67,11 @@ module HomebrewArgvExtension
at @n+1 or raise UsageError
end
def value arg
arg = find {|o| o =~ /--#{arg}=(.+)/}
$1 if arg
end
def force?
flag? '--force'
end
@ -98,8 +103,7 @@ module HomebrewArgvExtension
end
def json
json_rev = find {|o| o =~ /--json=.+/}
json_rev.split("=").last if json_rev
value 'json'
end
def build_head?