From f92aac6cd6199a633096de8aca1acfe4c5149cd2 Mon Sep 17 00:00:00 2001 From: Gautham Goli Date: Sun, 11 Nov 2018 20:17:33 +0530 Subject: [PATCH] postinstall: Use CLI::Parser to parse args --- Library/Homebrew/cmd/postinstall.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Library/Homebrew/cmd/postinstall.rb b/Library/Homebrew/cmd/postinstall.rb index 77320c2042..7db46b56e1 100644 --- a/Library/Homebrew/cmd/postinstall.rb +++ b/Library/Homebrew/cmd/postinstall.rb @@ -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` + + Rerun the post-install steps for . + 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)