Merge pull request #9511 from hyuraku/home-add-two-options
add two options (--formula and --cask) to cmd/home
This commit is contained in:
commit
967636aca0
@ -18,6 +18,11 @@ module Homebrew
|
|||||||
Open a <formula> or <cask>'s homepage in a browser, or open
|
Open a <formula> or <cask>'s homepage in a browser, or open
|
||||||
Homebrew's own homepage if no argument is provided.
|
Homebrew's own homepage if no argument is provided.
|
||||||
EOS
|
EOS
|
||||||
|
switch "--formula", "--formulae",
|
||||||
|
description: "Treat all named arguments as formulae."
|
||||||
|
switch "--cask", "--casks",
|
||||||
|
description: "Treat all named arguments as casks."
|
||||||
|
conflicts "--formula", "--cask"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -30,7 +35,9 @@ module Homebrew
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
homepages = args.named.to_formulae_and_casks.map do |formula_or_cask|
|
only = :formula if args.formula? && !args.cask?
|
||||||
|
only = :cask if args.cask? && !args.formula?
|
||||||
|
homepages = args.named.to_formulae_and_casks(only: only).map do |formula_or_cask|
|
||||||
puts "Opening homepage for #{name_of(formula_or_cask)}"
|
puts "Opening homepage for #{name_of(formula_or_cask)}"
|
||||||
formula_or_cask.homepage
|
formula_or_cask.homepage
|
||||||
end
|
end
|
||||||
|
|||||||
@ -211,6 +211,11 @@ error message if no logs are found.
|
|||||||
Open a *`formula`* or *`cask`*'s homepage in a browser, or open
|
Open a *`formula`* or *`cask`*'s homepage in a browser, or open
|
||||||
Homebrew's own homepage if no argument is provided.
|
Homebrew's own homepage if no argument is provided.
|
||||||
|
|
||||||
|
* `--formula`:
|
||||||
|
Treat all named arguments as formulae.
|
||||||
|
* `--cask`:
|
||||||
|
Treat all named arguments as casks.
|
||||||
|
|
||||||
### `info` [*`options`*] [*`formula`*|*`cask`*]
|
### `info` [*`options`*] [*`formula`*|*`cask`*]
|
||||||
|
|
||||||
Display brief statistics for your Homebrew installation.
|
Display brief statistics for your Homebrew installation.
|
||||||
|
|||||||
@ -258,6 +258,14 @@ The Gist will be marked private and will not appear in listings but will be acce
|
|||||||
.SS "\fBhome\fR [\fIformula\fR|\fIcask\fR]"
|
.SS "\fBhome\fR [\fIformula\fR|\fIcask\fR]"
|
||||||
Open a \fIformula\fR or \fIcask\fR\'s homepage in a browser, or open Homebrew\'s own homepage if no argument is provided\.
|
Open a \fIformula\fR or \fIcask\fR\'s homepage in a browser, or open Homebrew\'s own homepage if no argument is provided\.
|
||||||
.
|
.
|
||||||
|
.TP
|
||||||
|
\fB\-\-formula\fR
|
||||||
|
Treat all named arguments as formulae\.
|
||||||
|
.
|
||||||
|
.TP
|
||||||
|
\fB\-\-cask\fR
|
||||||
|
Treat all named arguments as casks\.
|
||||||
|
.
|
||||||
.SS "\fBinfo\fR [\fIoptions\fR] [\fIformula\fR|\fIcask\fR]"
|
.SS "\fBinfo\fR [\fIoptions\fR] [\fIformula\fR|\fIcask\fR]"
|
||||||
Display brief statistics for your Homebrew installation\.
|
Display brief statistics for your Homebrew installation\.
|
||||||
.
|
.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user