Merge pull request #5576 from GauthamGoli/sh-args
sh: Use CLI::Parser to parse args
This commit is contained in:
commit
66ed68f4eb
@ -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?
|
||||
|
Loading…
x
Reference in New Issue
Block a user