-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
22 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "cli/parser" | ||
require "abstract_command" | ||
|
||
module Homebrew | ||
module_function | ||
module Cmd | ||
class Repository < AbstractCommand | ||
sig { override.returns(String) } | ||
def self.command_name = "--repository" | ||
|
||
sig { returns(CLI::Parser) } | ||
def __repository_args | ||
Homebrew::CLI::Parser.new do | ||
description <<~EOS | ||
Display where Homebrew's Git repository is located. | ||
cmd_args do | ||
description <<~EOS | ||
Display where Homebrew's Git repository is located. | ||
If <user>`/`<repo> are provided, display where tap <user>`/`<repo>'s directory is located. | ||
EOS | ||
If <user>`/`<repo> are provided, display where tap <user>`/`<repo>'s directory is located. | ||
EOS | ||
|
||
named_args :tap | ||
end | ||
end | ||
|
||
sig { void } | ||
def __repository | ||
args = __repository_args.parse | ||
named_args :tap | ||
end | ||
|
||
if args.no_named? | ||
puts HOMEBREW_REPOSITORY | ||
else | ||
puts args.named.to_taps.map(&:path) | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters