postinstall: Use CLI::Parser to parse args

This commit is contained in:
Gautham Goli 2018-11-11 20:17:33 +05:30
parent b0f382c177
commit f92aac6cd6
No known key found for this signature in database
GPG Key ID: 6A9ABBC284468364

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)