diff options
| author | Max Howell | 2009-10-26 18:20:18 +0000 |
|---|---|---|
| committer | Max Howell | 2009-11-07 18:22:33 +0000 |
| commit | 03ca3e24d0ccd4633a29aab6b1dc1c43ead5c4e2 (patch) | |
| tree | 4f3b93ebca44669ac56cac4838b2d4335179bf8f /Library | |
| parent | 794a55a72b78acf4c5866f20ff39e6fcc759e439 (diff) | |
| download | brew-03ca3e24d0ccd4633a29aab6b1dc1c43ead5c4e2.tar.bz2 | |
Don't throw if named.empty?
Generally this isn't desired or useful.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/extend/ARGV.rb | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index 62ac933f7..e7585edbc 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -23,11 +23,7 @@ # module HomebrewArgvExtension def named - raise UsageError if private_named.empty? - private_named - end - def named_empty? - private_named.empty? + @named ||= reject{|arg| arg[0..0] == '-'} end def options select {|arg| arg[0..0] == '-'} @@ -108,15 +104,13 @@ Commands useful when contributing: To visit the Homebrew homepage type: brew home - EOS + EOS end -private - def private_named - @named ||= reject{|arg| arg[0..0] == '-'} - end + private + def downcased_unique_named - @downcased_unique_named ||= private_named.collect{|arg| arg.downcase}.uniq + @downcased_unique_named ||= named.collect{|arg| arg.downcase}.uniq end end |
