Skip to content

Commit

Permalink
Merge pull request #17728 from Homebrew/sponsors-maintainers-man-comp…
Browse files Browse the repository at this point in the history
…letions
  • Loading branch information
MikeMcQuaid authored Jul 14, 2024
2 parents 3e8f2c8 + 8ae18f4 commit fd62a15
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Library/Homebrew/cmd/--repository.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# typed: strict
# frozen_string_literal: true

require "abstract_command"

# This Ruby command exists to allow generation of completions for the Bash
# version.
# It is not meant to be run.
module Homebrew
module Cmd
class Repository < AbstractCommand
sig { override.returns(String) }
def self.command_name = "--repository"

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

named_args :tap

hide_from_man_page!
end

sig { override.void }
def run
raise StandardError,
"This command is just here for completions generation. " \
"It's actually defined in `cmd/--repository.sh` instead."
end
end
end
end
1 change: 1 addition & 0 deletions Library/Homebrew/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def self.internal_commands_aliases
def self.find_internal_commands(path)
find_commands(path).map(&:basename)
.map { basename_without_extension(_1) }
.uniq
end

def self.external_commands
Expand Down

0 comments on commit fd62a15

Please sign in to comment.