Move command_help_lines
into Help
module.
This commit is contained in:
parent
8e78990176
commit
0514e2dbba
@ -100,6 +100,14 @@ module Homebrew
|
|||||||
cmd_parser.generate_help_text
|
cmd_parser.generate_help_text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
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)
|
def comment_help(path)
|
||||||
# Otherwise read #: lines from the file.
|
# Otherwise read #: lines from the file.
|
||||||
help_lines = command_help_lines(path)
|
help_lines = command_help_lines(path)
|
||||||
|
@ -511,13 +511,6 @@ module Kernel
|
|||||||
end
|
end
|
||||||
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)
|
def redact_secrets(input, secrets)
|
||||||
secrets.compact
|
secrets.compact
|
||||||
.reduce(input) { |str, secret| str.gsub secret, "******" }
|
.reduce(input) { |str, secret| str.gsub secret, "******" }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user