diff --git a/Library/Homebrew/cask/lib/hbc/cask.rb b/Library/Homebrew/cask/lib/hbc/cask.rb index a193a394e9..47f3b176ae 100644 --- a/Library/Homebrew/cask/lib/hbc/cask.rb +++ b/Library/Homebrew/cask/lib/hbc/cask.rb @@ -74,8 +74,6 @@ module Hbc end def dumpcask - return unless CLI.debug? - odebug "Cask instance dumps in YAML:" odebug "Cask instance toplevel:", to_yaml [ diff --git a/Library/Homebrew/cask/lib/hbc/cli.rb b/Library/Homebrew/cask/lib/hbc/cli.rb index 37784f4c3c..d0c4f30df8 100644 --- a/Library/Homebrew/cask/lib/hbc/cli.rb +++ b/Library/Homebrew/cask/lib/hbc/cli.rb @@ -71,7 +71,6 @@ module Hbc FLAGS = { ["--[no-]binaries", :binaries] => true, - ["--debug", :debug] => false, ["--verbose", :verbose] => false, ["--outdated", :outdated] => false, ["--help", :help] => false, @@ -158,7 +157,7 @@ module Hbc run_command(command, *rest) rescue CaskError, CaskSha256MismatchError, ArgumentError => e msg = e.message - msg << e.backtrace.join("\n") if debug? + msg << e.backtrace.join("\n") if ARGV.debug? onoe msg exit 1 rescue StandardError, ScriptError, NoMemoryError => e @@ -239,7 +238,6 @@ module Hbc # for compat with Homebrew, not certain if this is desirable self.verbose = true if ARGV.verbose? - self.debug = true if ARGV.debug? remaining end diff --git a/Library/Homebrew/cask/lib/hbc/cli/internal_dump.rb b/Library/Homebrew/cask/lib/hbc/cli/internal_dump.rb index 8017a32cf7..94dd309bdb 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/internal_dump.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/internal_dump.rb @@ -12,7 +12,6 @@ module Hbc end def self.dump_casks(*cask_tokens) - CLI.debug = true # Yuck. At the moment this is the only way to make dumps visible count = 0 cask_tokens.each do |cask_token| begin diff --git a/Library/Homebrew/cask/lib/hbc/system_command.rb b/Library/Homebrew/cask/lib/hbc/system_command.rb index c14079bc8b..ac2a2346ec 100644 --- a/Library/Homebrew/cask/lib/hbc/system_command.rb +++ b/Library/Homebrew/cask/lib/hbc/system_command.rb @@ -154,7 +154,7 @@ module Hbc def self._parse_plist(command, output) raise CaskError, "Empty plist input" unless output =~ /\S/ output.sub!(/\A(.*?)(<\?\s*xml)/m, '\2') - _warn_plist_garbage(command, Regexp.last_match[1]) if CLI.debug? + _warn_plist_garbage(command, Regexp.last_match[1]) if ARGV.debug? output.sub!(%r{(<\s*/\s*plist\s*>)(.*?)\Z}m, '\1') _warn_plist_garbage(command, Regexp.last_match[2]) xml = Plist.parse_xml(output) diff --git a/Library/Homebrew/cask/lib/hbc/utils.rb b/Library/Homebrew/cask/lib/hbc/utils.rb index b2b65a08e0..4562fc4689 100644 --- a/Library/Homebrew/cask/lib/hbc/utils.rb +++ b/Library/Homebrew/cask/lib/hbc/utils.rb @@ -29,7 +29,7 @@ end # global methods def odebug(title, *sput) - return unless Hbc::CLI.debug? + return unless ARGV.debug? puts Formatter.headline(title, color: :magenta) puts sput unless sput.empty? end diff --git a/Library/Homebrew/test/cask/cli/options_spec.rb b/Library/Homebrew/test/cask/cli/options_spec.rb index 44a391b489..eb0bf1a49d 100644 --- a/Library/Homebrew/test/cask/cli/options_spec.rb +++ b/Library/Homebrew/test/cask/cli/options_spec.rb @@ -120,17 +120,6 @@ describe Hbc::CLI, :cask do end end - describe "--debug" do - it "sets the Cask debug method to true" do - begin - Hbc::CLI.process_options %w[help --debug] - expect(Hbc::CLI.debug?).to be true - ensure - Hbc::CLI.debug = false - end - end - end - describe "--help" do it "sets the Cask help method to true" do begin