brew/Library/Homebrew/cmd/command.rb
Mike McQuaid 4ffcd8a110
Various improvements for brew command
- Add a (large) speedup by moving some logic to Bash for the typical
  case of a normal or dev-cmd, Bash or Ruby command.
- Make `brew command` a non-developer command, I don't think it makes
  sense to consider it something needed for developing Homebrew.
- Update the manpage/tests/RBI accordingly.

Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2024-04-30 11:38:19 +01:00

29 lines
566 B
Ruby

# typed: strict
# frozen_string_literal: true
require "abstract_command"
require "commands"
module Homebrew
module Cmd
class Command < AbstractCommand
cmd_args do
description <<~EOS
Display the path to the file being used when invoking `brew` <cmd>.
EOS
named_args :command, min: 1
end
sig { override.void }
def run
args.named.each do |cmd|
path = Commands.path(cmd)
odie "Unknown command: #{cmd}" unless path
puts path
end
end
end
end
end