postinstall: Use CLI::Parser to parse args
This commit is contained in:
parent
b0f382c177
commit
f92aac6cd6
@ -3,11 +3,27 @@
|
|||||||
|
|
||||||
require "sandbox"
|
require "sandbox"
|
||||||
require "formula_installer"
|
require "formula_installer"
|
||||||
|
require "cli_parser"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
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
|
def postinstall
|
||||||
|
postinstall_args.parse
|
||||||
|
|
||||||
ARGV.resolved_formulae.each do |f|
|
ARGV.resolved_formulae.each do |f|
|
||||||
ohai "Postinstalling #{f}"
|
ohai "Postinstalling #{f}"
|
||||||
fi = FormulaInstaller.new(f)
|
fi = FormulaInstaller.new(f)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user