aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2013-07-07 09:14:10 -0700
committerAdam Vandenberg2013-07-17 06:58:10 -0700
commitd53c3ee48aedce7323305378d0493d6cb4d6de02 (patch)
treec55156bd6cd3a6e5812886524d8d1af955ccf556 /Library
parentfd10784636973a116855293e8b4f20cbe49b1089 (diff)
downloadhomebrew-d53c3ee48aedce7323305378d0493d6cb4d6de02.tar.bz2
add ARGV.value
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/ARGV.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb
index 106be88de..15ee645f8 100644
--- a/Library/Homebrew/extend/ARGV.rb
+++ b/Library/Homebrew/extend/ARGV.rb
@@ -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?