brew/Library/Homebrew/cmd/command.rb

29 lines
571 B
Ruby
Raw Normal View History

2024-03-19 11:50:53 -07:00
# typed: strict
# frozen_string_literal: true
2024-03-19 11:50:53 -07:00
require "abstract_command"
2016-09-07 20:09:22 +01:00
require "commands"
module Homebrew
module Cmd
2024-03-19 11:50:53 -07:00
class Command < AbstractCommand
cmd_args do
description <<~EOS
Display the path to the file being used when invoking `brew` <cmd>.
EOS
2016-09-26 01:44:51 +02:00
2024-03-19 11:50:53 -07:00
named_args :command, min: 1
end
2020-07-30 18:40:10 +02:00
2024-03-19 11:50:53 -07:00
sig { override.void }
def run
args.named.each do |cmd|
path = Commands.path(cmd)
odie "Unknown command: brew #{cmd}" unless path
2024-03-19 11:50:53 -07:00
puts path
end
end
2019-12-13 16:57:57 -05:00
end
end
end