From d443afc82d1bb945836ed9d021c08bb92fd0bd25 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sat, 26 Sep 2020 02:24:16 +0200 Subject: [PATCH] Improve `brew man` output. --- Library/Homebrew/cli/named_args.rb | 2 +- Library/Homebrew/dev-cmd/man.rb | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cli/named_args.rb b/Library/Homebrew/cli/named_args.rb index d40719838c..8a47787b58 100644 --- a/Library/Homebrew/cli/named_args.rb +++ b/Library/Homebrew/cli/named_args.rb @@ -21,7 +21,7 @@ module Homebrew end def to_formulae - @to_formulae ||= to_formulae_and_casks.select { |o| o.is_a?(Formula) }.freeze + @to_formulae ||= to_formulae_and_casks(only: :formula).freeze end def to_formulae_and_casks(only: nil) diff --git a/Library/Homebrew/dev-cmd/man.rb b/Library/Homebrew/dev-cmd/man.rb index 4d7f961f92..e34fe3cfcb 100644 --- a/Library/Homebrew/dev-cmd/man.rb +++ b/Library/Homebrew/dev-cmd/man.rb @@ -38,9 +38,14 @@ module Homebrew Commands.rebuild_internal_commands_completion_list regenerate_man_pages(preserve_date: args.fail_if_changed?, quiet: args.quiet?) - if system "git", "-C", HOMEBREW_REPOSITORY, "diff", "--quiet", "docs/Manpage.md", "manpages", "completions" + diff = system_command "git", args: [ + "-C", HOMEBREW_REPOSITORY, "diff", "--exit-code", "docs/Manpage.md", "manpages", "completions" + ] + if diff.status.success? puts "No changes to manpage or completions output detected." elsif args.fail_if_changed? + puts "Changes to manpage or completions detected:" + puts diff.stdout Homebrew.failed = true end end