From 71881fd7a66227738a654d98f04647d412c11980 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 5 Sep 2016 21:46:40 +0100 Subject: Add DEVELOPER COMMANDS to manpage. --- Library/Homebrew/dev-cmd/man.rb | 14 +++++++++----- Library/Homebrew/manpages/brew.1.md.erb | 4 ++++ 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/dev-cmd/man.rb b/Library/Homebrew/dev-cmd/man.rb index 9b2d60147..fdd4bf33d 100644 --- a/Library/Homebrew/dev-cmd/man.rb +++ b/Library/Homebrew/dev-cmd/man.rb @@ -33,11 +33,8 @@ module Homebrew convert_man_page(cask_markup, TARGET_MAN_PATH/"brew-cask.1") end - def build_man_page - template = (SOURCE_PATH/"brew.1.md.erb").read - variables = OpenStruct.new - - variables[:commands] = Pathname.glob("#{HOMEBREW_LIBRARY_PATH}/cmd/*.{rb,sh}"). + def path_glob_commands(glob) + Pathname.glob(glob). sort_by { |source_file| sort_key_for_path(source_file) }. map { |source_file| source_file.read.lines. @@ -46,7 +43,14 @@ module Homebrew join }. reject { |s| s.strip.empty? || s.include?("@hide_from_man_page") } + end + + def build_man_page + template = (SOURCE_PATH/"brew.1.md.erb").read + variables = OpenStruct.new + variables[:commands] = path_glob_commands("#{HOMEBREW_LIBRARY_PATH}/cmd/*.{rb,sh}") + variables[:developer_commands] = path_glob_commands("#{HOMEBREW_LIBRARY_PATH}/dev-cmd/*.{rb,sh}") variables[:maintainers] = (HOMEBREW_REPOSITORY/"README.md"). read[/Homebrew's current maintainers are (.*)\./, 1]. scan(/\[([^\]]*)\]/).flatten diff --git a/Library/Homebrew/manpages/brew.1.md.erb b/Library/Homebrew/manpages/brew.1.md.erb index 60557173d..d6828e9d0 100644 --- a/Library/Homebrew/manpages/brew.1.md.erb +++ b/Library/Homebrew/manpages/brew.1.md.erb @@ -50,6 +50,10 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note <%= commands.join("\n") %> +## DEVELOPER COMMANDS + +<%= developer_commands.join("\n") %> + ## EXTERNAL COMMANDS Homebrew, like `git`(1), supports external commands. These are executable -- cgit v1.2.3