diff options
| author | ilovezfs | 2016-01-30 23:09:45 -0800 |
|---|---|---|
| committer | Mike McQuaid | 2016-02-01 18:37:36 +0000 |
| commit | 604323e641ccd0b125716f4a337b1f9384236716 (patch) | |
| tree | 1ff8b0c3469bccdd3f1a0e5c3b82ca0de325bf42 /Library | |
| parent | f32c2a99740617140a019f1309113e2669684beb (diff) | |
| download | brew-604323e641ccd0b125716f4a337b1f9384236716.tar.bz2 | |
brew.rb: use $stderr for debug and errors.
Closes Homebrew/homebrew#48634.
Closes Homebrew/homebrew#48681.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/brew.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Library/brew.rb b/Library/brew.rb index 754102c2a..aaef58820 100755 --- a/Library/brew.rb +++ b/Library/brew.rb @@ -75,7 +75,11 @@ begin if empty_argv || (help_flag && (cmd.nil? || internal_cmd)) # TODO: - `brew help cmd` should display subcommand help require "cmd/help" - puts ARGV.usage + if empty_argv + $stderr.puts ARGV.usage + else + puts ARGV.usage + end exit ARGV.any? ? 0 : 1 end @@ -123,10 +127,10 @@ rescue UsageError abort ARGV.usage rescue SystemExit => e onoe "Kernel.exit" if ARGV.verbose? && !e.success? - puts e.backtrace if ARGV.debug? + $stderr.puts e.backtrace if ARGV.debug? raise rescue Interrupt => e - puts # seemingly a newline is typical + $stderr.puts # seemingly a newline is typical exit 130 rescue BuildError => e e.dump @@ -134,15 +138,15 @@ rescue BuildError => e rescue RuntimeError, SystemCallError => e raise if e.message.empty? onoe e - puts e.backtrace if ARGV.debug? + $stderr.puts e.backtrace if ARGV.debug? exit 1 rescue Exception => e onoe e if internal_cmd - puts "#{Tty.white}Please report this bug:" - puts " #{Tty.em}#{OS::ISSUES_URL}#{Tty.reset}" + $stderr.puts "#{Tty.white}Please report this bug:" + $stderr.puts " #{Tty.em}#{OS::ISSUES_URL}#{Tty.reset}" end - puts e.backtrace + $stderr.puts e.backtrace exit 1 else exit 1 if Homebrew.failed? |
