Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix completion generation for --repository #17728

Merged
merged 2 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Check warning on line 16 in Library/Homebrew/cmd/--repository.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/--repository.rb#L16

Added line #L16 was not covered by tests
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

Check warning on line 22 in Library/Homebrew/cmd/--repository.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/--repository.rb#L22

Added line #L22 was not covered by tests

hide_from_man_page!

Check warning on line 24 in Library/Homebrew/cmd/--repository.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/--repository.rb#L24

Added line #L24 was not covered by tests
end

sig { override.void }
def run
raise StandardError,

Check warning on line 29 in Library/Homebrew/cmd/--repository.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/--repository.rb#L29

Added line #L29 was not covered by tests
"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
Loading