Add magic token to hide commands from man page

Closes #402.
This commit is contained in:
Tim D. Smith 2016-06-28 08:08:12 -07:00
parent be3d33ea36
commit 9b36e83771
3 changed files with 5 additions and 3 deletions

View File

@ -91,8 +91,9 @@ module Homebrew
line.slice(2..-1). line.slice(2..-1).
sub(/^ \* /, "#{Tty.highlight}brew#{Tty.reset} "). sub(/^ \* /, "#{Tty.highlight}brew#{Tty.reset} ").
gsub(/`(.*?)`/, "#{Tty.highlight}\\1#{Tty.reset}"). gsub(/`(.*?)`/, "#{Tty.highlight}\\1#{Tty.reset}").
gsub(/<(.*?)>/, "#{Tty.em}\\1#{Tty.reset}") gsub(/<(.*?)>/, "#{Tty.em}\\1#{Tty.reset}").
end.join gsub("@hide_from_man_page", "")
end.join.strip
end end
end end
end end

View File

@ -51,7 +51,7 @@ module Homebrew
map { |line| line.slice(2..-1) }. map { |line| line.slice(2..-1) }.
join join
}. }.
reject { |s| s.strip.empty? } reject { |s| s.strip.empty? || s.include?("@hide_from_man_page") }
variables[:maintainers] = (HOMEBREW_REPOSITORY/"README.md"). variables[:maintainers] = (HOMEBREW_REPOSITORY/"README.md").
read[/Homebrew's current maintainers are (.*)\./, 1]. read[/Homebrew's current maintainers are (.*)\./, 1].

View File

@ -1,3 +1,4 @@
#: @hide_from_man_page
#: * `tests` [`-v`] [`--coverage`] [`--generic`] [`--no-compat`] [`--only=`<test_script/test_method>] [`--seed` <seed>] [`--trace`]: #: * `tests` [`-v`] [`--coverage`] [`--generic`] [`--no-compat`] [`--only=`<test_script/test_method>] [`--seed` <seed>] [`--trace`]:
#: Run Homebrew's unit and integration tests. #: Run Homebrew's unit and integration tests.