aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-08-14 20:11:40 -0500
committerJack Nagel2013-08-14 20:11:40 -0500
commit262afced5ec9ee67b0616ad454bb49b48e90ab53 (patch)
treede98435b38ef76545fe79a4573ff5f794e2f40f9 /Library
parentc4b278dfce430d9c11d9f3969009bba869b6e3f7 (diff)
downloadbrew-262afced5ec9ee67b0616ad454bb49b48e90ab53.tar.bz2
unpack: use ARGV.value
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/cmd/brew-unpack.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/Library/Contributions/cmd/brew-unpack.rb b/Library/Contributions/cmd/brew-unpack.rb
index 64621a393..86cf4018a 100755
--- a/Library/Contributions/cmd/brew-unpack.rb
+++ b/Library/Contributions/cmd/brew-unpack.rb
@@ -66,11 +66,10 @@ changes.
formulae = ARGV.formulae
raise FormulaUnspecifiedError if formulae.empty?
- unpack_dir = ARGV.options_only.select {|o| o.start_with? "--destdir="}
- if unpack_dir.empty?
- unpack_dir = Pathname.new Dir.getwd
+ if (dir = ARGV.value('destdir')).nil?
+ unpack_dir = Pathname.pwd
else
- unpack_dir = Pathname.new(unpack_dir.first.split('=')[1]).realpath
+ unpack_dir = Pathname.new(dir).realpath
unpack_dir.mkpath unless unpack_dir.exist?
end