Merge pull request #5576 from GauthamGoli/sh-args

sh: Use CLI::Parser to parse args
This commit is contained in:
Gautham Goli 2019-01-22 19:00:03 +05:30 committed by GitHub
commit 66ed68f4eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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?