Merge pull request #8192 from Bo98/prof-args-fix

dev-cmd/prof: improve arg passing
This commit is contained in:
Mike McQuaid 2020-08-10 09:57:41 +01:00 committed by GitHub
commit 4de4c3d4d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

View File

@ -8,20 +8,19 @@ module Homebrew
def prof_args def prof_args
Homebrew::CLI::Parser.new do Homebrew::CLI::Parser.new do
usage_banner <<~EOS usage_banner <<~EOS
`prof` <command> `prof` [<command>]
Run Homebrew with the Ruby profiler, e.g. `brew prof readall`. Run Homebrew with the Ruby profiler, e.g. `brew prof readall`.
EOS EOS
min_named 1
end end
end end
def prof def prof
prof_args.parse args = prof_args.parse
Homebrew.install_gem_setup_path! "ruby-prof", version: "0.18.0" Homebrew.install_gem_setup_path! "ruby-prof", version: "0.18.0"
FileUtils.mkdir_p "prof" FileUtils.mkdir_p "prof"
brew_rb = (HOMEBREW_LIBRARY_PATH/"brew.rb").resolved_path brew_rb = (HOMEBREW_LIBRARY_PATH/"brew.rb").resolved_path
safe_system "ruby-prof", "--printer=multi", "--file=prof", brew_rb, "--", *ARGV safe_system "ruby-prof", "--printer=multi", "--file=prof", brew_rb, "--", *args.named
end end
end end

View File

@ -981,7 +981,7 @@ Apply the bottle commit and publish bottles to Bintray.
* `--root-url`: * `--root-url`:
Use the specified *`URL`* as the root of the bottle's URL instead of Homebrew's default. Use the specified *`URL`* as the root of the bottle's URL instead of Homebrew's default.
### `prof` *`command`* ### `prof` [*`command`*]
Run Homebrew with the Ruby profiler, e.g. `brew prof readall`. Run Homebrew with the Ruby profiler, e.g. `brew prof readall`.

View File

@ -1307,7 +1307,7 @@ Upload to the specified Bintray organisation (default: \fBhomebrew\fR)\.
\fB\-\-root\-url\fR \fB\-\-root\-url\fR
Use the specified \fIURL\fR as the root of the bottle\'s URL instead of Homebrew\'s default\. Use the specified \fIURL\fR as the root of the bottle\'s URL instead of Homebrew\'s default\.
. .
.SS "\fBprof\fR \fIcommand\fR" .SS "\fBprof\fR [\fIcommand\fR]"
Run Homebrew with the Ruby profiler, e\.g\. \fBbrew prof readall\fR\. Run Homebrew with the Ruby profiler, e\.g\. \fBbrew prof readall\fR\.
. .
.SS "\fBrelease\-notes\fR [\fIoptions\fR] [\fIprevious_tag\fR] [\fIend_ref\fR]" .SS "\fBrelease\-notes\fR [\fIoptions\fR] [\fIprevious_tag\fR] [\fIend_ref\fR]"