Skip to content
Snippets Groups Projects
Commit 9cae9f28 authored by Elizabeth Tackett's avatar Elizabeth Tackett
Browse files

update argument handling and syntactical feedback changes

parent 3ecb90b9
No related branches found
No related tags found
No related merge requests found
...@@ -8,13 +8,11 @@ module Homebrew ...@@ -8,13 +8,11 @@ module Homebrew
def bump_args def bump_args
Homebrew::CLI::Parser.new do Homebrew::CLI::Parser.new do
usage_banner <<~EOS usage_banner <<~EOS
`bump` [<options>] `bump` [<options>] [<formula>]
Display out-of-date brew formulae and the latest version available. Display out-of-date brew formulae and the latest version available.
Also displays whether a pull request has been opened with the URL. Also displays whether a pull request has been opened with the URL.
EOS EOS
flag "--formula=",
description: "Return results for package by name."
flag "--limit=", flag "--limit=",
description: "Limit number of package results returned." description: "Limit number of package results returned."
switch :verbose switch :verbose
...@@ -25,7 +23,7 @@ module Homebrew ...@@ -25,7 +23,7 @@ module Homebrew
def bump def bump
args = bump_args.parse args = bump_args.parse
requested_formula = args.formula requested_formula = args.formulae.first.to_s
requested_limit = args.limit.to_i if args.limit.present? requested_limit = args.limit.to_i if args.limit.present?
raise FormulaUnavailableError, requested_formula if requested_formula && !validate_formula(requested_formula) raise FormulaUnavailableError, requested_formula if requested_formula && !validate_formula(requested_formula)
......
...@@ -11,7 +11,7 @@ describe "brew bump" do ...@@ -11,7 +11,7 @@ describe "brew bump" do
it "returns data for valid specified formula" do it "returns data for valid specified formula" do
install_test_formula "testball" install_test_formula "testball"
expect { brew "bump", "--formula=testball" } expect { brew "bump", "testball" }
.to output.to_stdout .to output.to_stdout
.and not_to_output.to_stderr .and not_to_output.to_stderr
.and be_a_success .and be_a_success
......
...@@ -49,6 +49,7 @@ module Repology ...@@ -49,6 +49,7 @@ module Repology
end end
puts "#{outdated_packages.size} outdated #{"package".pluralize(outdated_packages.size)} found" puts "#{outdated_packages.size} outdated #{"package".pluralize(outdated_packages.size)} found"
puts
outdated_packages outdated_packages
end end
...@@ -90,7 +91,7 @@ module Repology ...@@ -90,7 +91,7 @@ module Repology
pull_requests = GitHub.fetch_pull_requests(formula_name, tap_full_name, state: "open") pull_requests = GitHub.fetch_pull_requests(formula_name, tap_full_name, state: "open")
if pull_requests.try(:any?) if pull_requests.try(:any?)
pull_requests = pull_requests.map { |pr| "#{pr["title"]} (#{Formatter.url(pr["url"])})" }.join(", ") pull_requests = pull_requests.map { |pr| "#{pr["title"]} (#{Formatter.url(pr["html_url"])})" }.join(", ")
end end
pull_requests = "None" if pull_requests.empty? pull_requests = "None" if pull_requests.empty?
......
...@@ -727,13 +727,11 @@ at its original value, while `--no-rebuild` will remove it. ...@@ -727,13 +727,11 @@ at its original value, while `--no-rebuild` will remove it.
* `--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.
### `bump` [*`options`*] ### `bump` [*`options`*] [*`formula`*]
Display out-of-date brew formulae and the latest version available. Also Display out-of-date brew formulae and the latest version available. Also
displays whether a pull request has been opened with the URL. displays whether a pull request has been opened with the URL.
* `--formula`:
Return results for package by name.
* `--limit`: * `--limit`:
Limit number of package results returned. Limit number of package results returned.
...@@ -1219,21 +1217,17 @@ flags which will help find keg-only dependencies like `openssl`, `icu4c`, etc. ...@@ -1219,21 +1217,17 @@ flags which will help find keg-only dependencies like `openssl`, `icu4c`, etc.
Read the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout. Read the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout.
* `--global`: * `--global`:
Read the `Brewfile` from `~/.Brewfile`. Read the `Brewfile` from `~/.Brewfile`.
* `-v`, `--verbose`:
`install` prints output from commands as they are run. `check` lists all missing dependencies.
* `--no-upgrade`: * `--no-upgrade`:
`install` won't run `brew upgrade` on outdated dependencies. Note they may still be upgraded by `brew install` if needed. `install` won't run `brew upgrade` on outdated dependencies. Note they may still be upgraded by `brew install` if needed.
* `-f`, `--force`:
`dump` overwrites an existing `Brewfile`. `cleanup` actually performs its cleanup operations.
* `--no-lock`: * `--no-lock`:
`install` won't output a `Brewfile.lock.json`. `install` won't output a `Brewfile.lock.json`.
* `--all`: * `--all`:
`list` all dependencies. `list` all dependencies.
* `--formula`: * `--brews`:
`list` Homebrew dependencies. `list` Homebrew dependencies.
* `--cask`: * `--casks`:
`list` Homebrew Cask dependencies. `list` Homebrew Cask dependencies.
* `--tap`: * `--taps`:
`list` tap dependencies. `list` tap dependencies.
* `--mas`: * `--mas`:
`list` Mac App Store dependencies. `list` Mac App Store dependencies.
...@@ -1306,8 +1300,6 @@ and Linux workers. ...@@ -1306,8 +1300,6 @@ and Linux workers.
use the `git` repository of the given tap. Defaults to the core tap for syntax checking. use the `git` repository of the given tap. Defaults to the core tap for syntax checking.
* `--fail-fast`: * `--fail-fast`:
immediately exit on a failing step. immediately exit on a failing step.
* `-v`, `--verbose`:
print test step output in real time. Has the side effect of passing output as raw bytes instead of re-encoding in UTF-8.
* `--test-default-formula`: * `--test-default-formula`:
use a default testing formula when not building a tap and no other formulae are specified. use a default testing formula when not building a tap and no other formulae are specified.
* `--bintray-org`: * `--bintray-org`:
......
...@@ -960,14 +960,10 @@ When passed with \fB\-\-write\fR, a new commit will not generated after writing ...@@ -960,14 +960,10 @@ When passed with \fB\-\-write\fR, a new commit will not generated after writing
\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 "\fBbump\fR [\fIoptions\fR]" .SS "\fBbump\fR [\fIoptions\fR] [\fIformula\fR]"
Display out\-of\-date brew formulae and the latest version available\. Also displays whether a pull request has been opened with the URL\. Display out\-of\-date brew formulae and the latest version available\. Also displays whether a pull request has been opened with the URL\.
. .
.TP .TP
\fB\-\-formula\fR
Return results for package by name\.
.
.TP
\fB\-\-limit\fR \fB\-\-limit\fR
Limit number of package results returned\. Limit number of package results returned\.
. .
...@@ -1576,18 +1572,10 @@ Read the \fBBrewfile\fR from this location\. Use \fB\-\-file=\-\fR to pipe to st ...@@ -1576,18 +1572,10 @@ Read the \fBBrewfile\fR from this location\. Use \fB\-\-file=\-\fR to pipe to st
Read the \fBBrewfile\fR from \fB~/\.Brewfile\fR\. Read the \fBBrewfile\fR from \fB~/\.Brewfile\fR\.
. .
.TP .TP
\fB\-v\fR, \fB\-\-verbose\fR
\fBinstall\fR prints output from commands as they are run\. \fBcheck\fR lists all missing dependencies\.
.
.TP
\fB\-\-no\-upgrade\fR \fB\-\-no\-upgrade\fR
\fBinstall\fR won\'t run \fBbrew upgrade\fR on outdated dependencies\. Note they may still be upgraded by \fBbrew install\fR if needed\. \fBinstall\fR won\'t run \fBbrew upgrade\fR on outdated dependencies\. Note they may still be upgraded by \fBbrew install\fR if needed\.
. .
.TP .TP
\fB\-f\fR, \fB\-\-force\fR
\fBdump\fR overwrites an existing \fBBrewfile\fR\. \fBcleanup\fR actually performs its cleanup operations\.
.
.TP
\fB\-\-no\-lock\fR \fB\-\-no\-lock\fR
\fBinstall\fR won\'t output a \fBBrewfile\.lock\.json\fR\. \fBinstall\fR won\'t output a \fBBrewfile\.lock\.json\fR\.
. .
...@@ -1596,15 +1584,15 @@ Read the \fBBrewfile\fR from \fB~/\.Brewfile\fR\. ...@@ -1596,15 +1584,15 @@ Read the \fBBrewfile\fR from \fB~/\.Brewfile\fR\.
\fBlist\fR all dependencies\. \fBlist\fR all dependencies\.
. .
.TP .TP
\fB\-\-formula\fR \fB\-\-brews\fR
\fBlist\fR Homebrew dependencies\. \fBlist\fR Homebrew dependencies\.
. .
.TP .TP
\fB\-\-cask\fR \fB\-\-casks\fR
\fBlist\fR Homebrew Cask dependencies\. \fBlist\fR Homebrew Cask dependencies\.
. .
.TP .TP
\fB\-\-tap\fR \fB\-\-taps\fR
\fBlist\fR tap dependencies\. \fBlist\fR tap dependencies\.
. .
.TP .TP
...@@ -1700,10 +1688,6 @@ use the \fBgit\fR repository of the given tap\. Defaults to the core tap for syn ...@@ -1700,10 +1688,6 @@ use the \fBgit\fR repository of the given tap\. Defaults to the core tap for syn
immediately exit on a failing step\. immediately exit on a failing step\.
. .
.TP .TP
\fB\-v\fR, \fB\-\-verbose\fR
print test step output in real time\. Has the side effect of passing output as raw bytes instead of re\-encoding in UTF\-8\.
.
.TP
\fB\-\-test\-default\-formula\fR \fB\-\-test\-default\-formula\fR
use a default testing formula when not building a tap and no other formulae are specified\. use a default testing formula when not building a tap and no other formulae are specified\.
. .
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment