diff --git a/Library/Homebrew/help.rb b/Library/Homebrew/help.rb index 1bfe71520e..8b577b8c82 100644 --- a/Library/Homebrew/help.rb +++ b/Library/Homebrew/help.rb @@ -104,6 +104,14 @@ module Homebrew end private_class_method :parser_help + def command_help_lines(path) + path.read + .lines + .grep(/^#:/) + .map { |line| line.slice(2..-1).delete_prefix(" ") } + end + private_class_method :command_help_lines + def comment_help(path) # Otherwise read #: lines from the file. help_lines = command_help_lines(path) diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 87d94100d5..42e4c6667a 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -511,13 +511,6 @@ module Kernel end end - def command_help_lines(path) - path.read - .lines - .grep(/^#:/) - .map { |line| line.slice(2..-1).delete_prefix(" ") } - end - def redact_secrets(input, secrets) secrets.compact .reduce(input) { |str, secret| str.gsub secret, "******" }