Merge pull request #5309 from GauthamGoli/postinstall-args

postinstall: Use CLI::Parser to parse args
This commit is contained in:
Mike McQuaid 2018-11-24 11:42:57 +00:00 committed by GitHub
commit 5203756803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,11 +3,27 @@
require "sandbox"
require "formula_installer"
require "cli_parser"
module Homebrew
module_function
def postinstall_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`postinstall` <formula>
Rerun the post-install steps for <formula>.
EOS
switch :verbose
switch :force
switch :debug
end
end
def postinstall
postinstall_args.parse
ARGV.resolved_formulae.each do |f|
ohai "Postinstalling #{f}"
fi = FormulaInstaller.new(f)