diff --git a/Library/Homebrew/cmd/cat.rb b/Library/Homebrew/cmd/cat.rb index f593f371fe..f5cb930e14 100644 --- a/Library/Homebrew/cmd/cat.rb +++ b/Library/Homebrew/cmd/cat.rb @@ -25,6 +25,6 @@ module Homebrew else "cat" end - safe_system pager, args.formulae.first.path, *args.passthrough + safe_system pager, args.formulae_paths.first, *args.passthrough end end diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index 0459e23242..80ac45a233 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -45,7 +45,7 @@ module Homebrew elsif args.named.any? { |tap| tap.count("/") == 1 } args.named.map { |tap| Tap.fetch(tap).path } else - args.formulae.map(&:path) + args.formulae_paths end only_cops = args.only_cops diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 1eb717569f..58eceece2a 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -84,7 +84,7 @@ module Homebrew files = Tap.map(&:formula_dir) else ff = args.resolved_formulae - files = args.resolved_formulae.map(&:path) + files = args.formulae_paths end only_cops = args.only_cops diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index 30d63101f6..25ee7cc91f 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -14,7 +14,6 @@ module Homebrew Open in the editor set by `EDITOR` or `HOMEBREW_EDITOR`, or open the Homebrew repository for editing if no formula is provided. EOS - switch :force switch :verbose switch :debug end @@ -31,16 +30,10 @@ module Homebrew EOS end + paths = args.formulae_paths.presence + # If no brews are listed, open the project root in an editor. - paths = [HOMEBREW_REPOSITORY] if args.no_named? - - # Don't use args.formulae as that will throw if the file doesn't parse - paths ||= args.named.map do |name| - path = Formulary.path(name) - raise FormulaUnavailableError, name if !path.file? && !args.force? - - path - end + paths ||= [HOMEBREW_REPOSITORY] exec_editor(*paths) end diff --git a/Library/Homebrew/dev-cmd/formula.rb b/Library/Homebrew/dev-cmd/formula.rb index 8776a7ef4d..8a782ee4e8 100644 --- a/Library/Homebrew/dev-cmd/formula.rb +++ b/Library/Homebrew/dev-cmd/formula.rb @@ -22,6 +22,6 @@ module Homebrew def formula formula_args.parse - args.resolved_formulae.each { |f| puts f.path } + args.formulae_paths.each(&method(:puts)) end end