From 114d5b091b0575f8926fb32e69ebe87c9a717cae Mon Sep 17 00:00:00 2001
From: Gautham Goli <goligautham@gmail.com>
Date: Tue, 22 Jan 2019 01:41:45 +0530
Subject: [PATCH] sh: Use CLI::Parser to parse args

---
 Library/Homebrew/cmd/sh.rb | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/Library/Homebrew/cmd/sh.rb b/Library/Homebrew/cmd/sh.rb
index 73bf72044a..071f098917 100644
--- a/Library/Homebrew/cmd/sh.rb
+++ b/Library/Homebrew/cmd/sh.rb
@@ -9,11 +9,31 @@
 
 require "extend/ENV"
 require "formula"
+require "cli_parser"
 
 module Homebrew
   module_function
 
+  def sh_args
+    Homebrew::CLI::Parser.new do
+      usage_banner <<~EOS
+        `sh` [<options>]
+
+        Start a Homebrew build environment shell. Uses our years-battle-hardened
+        Homebrew build logic to help your `./configure && make && make install`
+        or even your `gem install` succeed. Especially handy if you run Homebrew
+        in an Xcode-only configuration since it adds tools like `make` to your `PATH`
+        which otherwise build systems would not find.
+      EOS
+      flag "--env=",
+        description: "Use the standard `PATH` instead of superenv's, when <std> is passed"
+      switch :verbose
+      switch :debug
+    end
+  end
+
   def sh
+    sh_args.parse
     ENV.activate_extensions!
 
     if superenv?
-- 
GitLab