From d0c1af4f9e3f87385ff1978376f4d9a7c18da028 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Fri, 29 Mar 2024 18:31:39 -0700 Subject: [PATCH] Port Homebrew::Cmd::Help --- Library/Homebrew/cmd/help.rb | 13 +++++++++---- Library/Homebrew/test/cmd/help_spec.rb | 4 +++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/cmd/help.rb b/Library/Homebrew/cmd/help.rb index 2d286ad465..66d1ec8dac 100644 --- a/Library/Homebrew/cmd/help.rb +++ b/Library/Homebrew/cmd/help.rb @@ -1,11 +1,16 @@ -# typed: strict +# typed: strong # frozen_string_literal: true +require "abstract_command" require "help" module Homebrew - sig { returns(T.noreturn) } - def help - Help.help + module Cmd + class HelpCmd < AbstractCommand + sig { override.void } + def run + Help.help + end + end end end diff --git a/Library/Homebrew/test/cmd/help_spec.rb b/Library/Homebrew/test/cmd/help_spec.rb index ff82501f5a..236a640690 100644 --- a/Library/Homebrew/test/cmd/help_spec.rb +++ b/Library/Homebrew/test/cmd/help_spec.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true -RSpec.describe "brew", :integration_test do +require "cmd/help" + +RSpec.describe Homebrew::Cmd::HelpCmd, :integration_test do describe "help" do it "prints help for a documented Ruby command" do expect { brew "help", "cat" }