diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index d365b5b77b..080bc6f109 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -27,15 +27,15 @@ module Cask new_cask: nil) # `new_cask` implies `online` and `strict` - online = new_cask if online.blank? - strict = new_cask if strict.blank? + online = new_cask if online.nil? + strict = new_cask if strict.nil? # `online` implies `appcast` and `download` - appcast = online if appcast.nil? # `appcast` is `nil` if neither `--appcast` nor `--no-appcast` are passed - download = online if download.blank? + appcast = online if appcast.nil? + download = online if download.nil? # `new_cask` implies `token_conflicts` - token_conflicts = new_cask if token_conflicts.blank? + token_conflicts = new_cask if token_conflicts.nil? @cask = cask @appcast = appcast diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 1f58971355..5ca4cb4f78 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -206,14 +206,17 @@ module Homebrew require "cask/cmd/abstract_command" require "cask/cmd/audit" + # For switches, we add `|| nil` so that `nil` will be passed instead of `false` if they aren't set. + # This way, we can distinguish between "not set" and "set to false". Cask::Cmd::Audit.audit_casks( *audit_casks, download: nil, + # No need for `|| nil` because this is a `--[no-]appcast` and automatically sets itself to `nil` if not passed appcast: args.appcast?, - online: args.online?, - strict: args.strict?, - new_cask: args.new_cask?, - token_conflicts: args.token_conflicts?, + online: args.online? || nil, + strict: args.strict? || nil, + new_cask: args.new_cask? || nil, + token_conflicts: args.token_conflicts? || nil, quarantine: nil, any_named_args: !no_named_args, language: nil,