diff options
| author | Mike McQuaid | 2014-02-13 20:26:29 +0000 | 
|---|---|---|
| committer | Mike McQuaid | 2014-02-14 18:32:56 +0000 | 
| commit | bf41a56f1985ce6f38a9e5f8403f3512ce291d61 (patch) | |
| tree | 65f40a05f4ae8792e28d90463feb3ccb8020579b /Library/brew.rb | |
| parent | e974f97fef4b91e99b96123ca7ce989e43930422 (diff) | |
| download | homebrew-bf41a56f1985ce6f38a9e5f8403f3512ce291d61.tar.bz2 | |
brew: check for --help and friends in more of ARGV
Let's check for e.g. --help anywhere in the ARGV array rather than just
the first value to avoid brew upgrade --help causing problems.
Closes #26675.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/brew.rb')
| -rwxr-xr-x | Library/brew.rb | 10 | 
1 files changed, 5 insertions, 5 deletions
| diff --git a/Library/brew.rb b/Library/brew.rb index 455f30464..27d66d20f 100755 --- a/Library/brew.rb +++ b/Library/brew.rb @@ -16,14 +16,14 @@ $:.unshift(HOMEBREW_LIBRARY_PATH + '/vendor')  $:.unshift(HOMEBREW_LIBRARY_PATH)  require 'global' -case ARGV.first when '-h', '--help', '--usage', '-?', 'help', nil +if ARGV.help?    require 'cmd/help' -  puts Homebrew.help_s -  exit ARGV.first ? 0 : 1 -when '--version' +  puts ARGV.usage +  exit ARGV.any? ? 0 : 1 +elsif ARGV.version?    puts HOMEBREW_VERSION    exit 0 -when '-v' +elsif ARGV.first == '-v'    puts "Homebrew #{HOMEBREW_VERSION}"    # Shift the -v to the end of the parameter list    ARGV << ARGV.shift | 
