37 lines
1.1 KiB
Ruby
Raw Normal View History

2020-10-10 14:16:11 +02:00
# typed: false
# frozen_string_literal: true
module Homebrew
2020-10-20 12:03:48 +02:00
extend T::Sig
2016-09-26 01:44:51 +02:00
module_function
2020-10-20 12:03:48 +02:00
sig { returns(CLI::Parser) }
def man_args
Homebrew::CLI::Parser.new do
description <<~EOS
2018-09-28 21:39:52 +05:30
Generate Homebrew's manpages.
EOS
switch "--fail-if-not-changed",
description: "Return a failing status code if no changes are detected in the manpage outputs. "\
"This can be used to notify CI when the manpages are out of date. Additionally, "\
2019-04-30 08:44:35 +01:00
"the date used in new manpages will match those in the existing manpages (to allow "\
"comparison without factoring in the date)."
2021-01-10 14:26:40 -05:00
named_args :none
2019-01-30 21:33:30 +00:00
hide_from_man_page!
end
end
def man
odeprecated "`brew man`", "`brew generate-man-completions`"
2018-09-08 22:21:04 +05:30
args = man_args.parse
cmd = ["generate-man-completions"]
cmd << "--fail-if-not-changed" if args.fail_if_not_changed?
brew_rb = (HOMEBREW_LIBRARY_PATH/"brew.rb").resolved_path
system ENV["HOMEBREW_RUBY_PATH"], brew_rb, *cmd
end
end