brew/Library/Homebrew/cmd/--repository.rb

33 lines
687 B
Ruby
Raw Normal View History

2023-08-08 13:54:59 -07:00
# typed: strict
# frozen_string_literal: true
2024-04-01 16:02:41 -07:00
require "abstract_command"
module Homebrew
2024-04-01 16:02:41 -07:00
module Cmd
class Repository < AbstractCommand
sig { override.returns(String) }
def self.command_name = "--repository"
2016-09-26 01:44:51 +02:00
2024-04-01 16:02:41 -07:00
cmd_args do
description <<~EOS
Display where Homebrew's Git repository is located.
2019-01-30 21:29:49 +00:00
2024-04-01 16:02:41 -07:00
If <user>`/`<repo> are provided, display where tap <user>`/`<repo>'s directory is located.
EOS
2021-01-10 14:26:40 -05:00
2024-04-01 16:02:41 -07:00
named_args :tap
end
2019-01-30 21:29:49 +00:00
2024-04-01 16:02:41 -07:00
sig { override.void }
def run
if args.no_named?
puts HOMEBREW_REPOSITORY
else
puts args.named.to_taps.map(&:path)
end
end
end
end
end