desc/audit: remove messages obviated by new arg parser

This commit is contained in:
EricFromCanada 2019-12-11 14:59:47 -05:00
parent e78836fda9
commit f0270a585c
2 changed files with 3 additions and 14 deletions

View File

@ -40,11 +40,7 @@ module Homebrew
search_type << :either if args.search search_type << :either if args.search
search_type << :name if args.name search_type << :name if args.name
search_type << :desc if args.description search_type << :desc if args.description
if search_type.size > 1 odie "You must provide a search term." if search_type.present? && ARGV.named.empty?
odie "Pick one, and only one, of -s/--search, -n/--name, or -d/--description."
elsif search_type.present? && ARGV.named.empty?
odie "You must provide a search term."
end
results = if search_type.empty? results = if search_type.empty?
raise FormulaUnspecifiedError if ARGV.named.empty? raise FormulaUnspecifiedError if ARGV.named.empty?

View File

@ -57,7 +57,8 @@ module Homebrew
switch :verbose switch :verbose
switch :debug switch :debug
conflicts "--only", "--except" conflicts "--only", "--except"
conflicts "--only-cops", "--except-cops" conflicts "--only-cops", "--except-cops", "--strict"
conflicts "--only-cops", "--except-cops", "--only"
end end
end end
@ -88,13 +89,6 @@ module Homebrew
only_cops = args.only_cops only_cops = args.only_cops
except_cops = args.except_cops except_cops = args.except_cops
if only_cops && except_cops
odie "--only-cops and --except-cops cannot be used simultaneously!"
elsif (only_cops || except_cops) && (strict || args.only)
odie "--only-cops/--except-cops and --strict/--only cannot be used simultaneously!"
end
options = { fix: args.fix? } options = { fix: args.fix? }
if only_cops if only_cops
@ -995,7 +989,6 @@ module Homebrew
def audit def audit
only_audits = @only only_audits = @only
except_audits = @except except_audits = @except
odie "--only and --except cannot be used simultaneously!" if only_audits && except_audits
methods.map(&:to_s).grep(/^audit_/).each do |audit_method_name| methods.map(&:to_s).grep(/^audit_/).each do |audit_method_name|
name = audit_method_name.gsub(/^audit_/, "") name = audit_method_name.gsub(/^audit_/, "")