Skip to content
Snippets Groups Projects
Unverified Commit ef068040 authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #9385 from hyuraku/add-flag-to-deps-command

add two flag to deps --installed
parents 5ad94967 33fccb46
No related branches found
No related tags found
No related merge requests found
...@@ -57,8 +57,15 @@ module Homebrew ...@@ -57,8 +57,15 @@ module Homebrew
description: "Switch into the mode used by the `--all` option, but only list dependencies "\ description: "Switch into the mode used by the `--all` option, but only list dependencies "\
"for each provided <formula>, one formula per line. This is used for "\ "for each provided <formula>, one formula per line. This is used for "\
"debugging the `--installed`/`--all` display mode." "debugging the `--installed`/`--all` display mode."
switch "--formula", "--formulae",
depends_on: "--installed",
description: "Treat all named arguments as formulae."
switch "--cask", "--casks",
depends_on: "--installed",
description: "Treat all named arguments as casks."
conflicts "--installed", "--all" conflicts "--installed", "--all"
conflicts "--formula", "--cask"
formula_options formula_options
end end
end end
...@@ -82,7 +89,13 @@ module Homebrew ...@@ -82,7 +89,13 @@ module Homebrew
dependents = if args.named.present? dependents = if args.named.present?
sorted_dependents(args.named.to_formulae_and_casks) sorted_dependents(args.named.to_formulae_and_casks)
elsif args.installed? elsif args.installed?
sorted_dependents(Formula.installed + Cask::Caskroom.casks(config: Cask::Config.from_args(args))) if args.formula? && !args.cask?
sorted_dependents(Formula.installed)
elsif args.cask? && !args.formula?
sorted_dependents(Cask::Caskroom.casks(config: Cask::Config.from_args(args)))
else
sorted_dependents(Formula.installed + Cask::Caskroom.casks(config: Cask::Config.from_args(args)))
end
else else
raise FormulaUnspecifiedError raise FormulaUnspecifiedError
end end
...@@ -100,8 +113,14 @@ module Homebrew ...@@ -100,8 +113,14 @@ module Homebrew
if args.no_named? if args.no_named?
raise FormulaUnspecifiedError unless args.installed? raise FormulaUnspecifiedError unless args.installed?
puts_deps sorted_dependents(Formula.installed + Cask::Caskroom.casks(config: Cask::Config.from_args(args))), sorted_dependents_formulae_and_casks = if args.formula? && !args.cask?
recursive: recursive, args: args sorted_dependents(Formula.installed)
elsif args.cask? && !args.formula?
sorted_dependents(Cask::Caskroom.casks(config: Cask::Config.from_args(args)))
else
sorted_dependents(Formula.installed + Cask::Caskroom.casks(config: Cask::Config.from_args(args)))
end
pus_deps sorted_dependents_formulae_and_casks, recursive: recursive, args: args
return return
end end
......
...@@ -129,6 +129,10 @@ show the intersection of dependencies for each formula. ...@@ -129,6 +129,10 @@ show the intersection of dependencies for each formula.
List dependencies for all available formulae. List dependencies for all available formulae.
* `--for-each`: * `--for-each`:
Switch into the mode used by the `--all` option, but only list dependencies for each provided *`formula`*, one formula per line. This is used for debugging the `--installed`/`--all` display mode. Switch into the mode used by the `--all` option, but only list dependencies for each provided *`formula`*, one formula per line. This is used for debugging the `--installed`/`--all` display mode.
* `--formula`:
Treat all named arguments as formulae.
* `--cask`:
Treat all named arguments as casks.
### `desc` [*`options`*] (*`text`*|`/`*`text`*`/`|*`formula`*) ### `desc` [*`options`*] (*`text`*|`/`*`text`*`/`|*`formula`*)
......
...@@ -152,6 +152,14 @@ List dependencies for all available formulae\. ...@@ -152,6 +152,14 @@ List dependencies for all available formulae\.
\fB\-\-for\-each\fR \fB\-\-for\-each\fR
Switch into the mode used by the \fB\-\-all\fR option, but only list dependencies for each provided \fIformula\fR, one formula per line\. This is used for debugging the \fB\-\-installed\fR/\fB\-\-all\fR display mode\. Switch into the mode used by the \fB\-\-all\fR option, but only list dependencies for each provided \fIformula\fR, one formula per line\. This is used for debugging the \fB\-\-installed\fR/\fB\-\-all\fR display mode\.
. .
.TP
\fB\-\-formula\fR
Treat all named arguments as formulae\.
.
.TP
\fB\-\-cask\fR
Treat all named arguments as casks\.
.
.SS "\fBdesc\fR [\fIoptions\fR] (\fItext\fR|\fB/\fR\fItext\fR\fB/\fR|\fIformula\fR)" .SS "\fBdesc\fR [\fIoptions\fR] (\fItext\fR|\fB/\fR\fItext\fR\fB/\fR|\fIformula\fR)"
Display \fIformula\fR\'s name and one\-line description\. Formula descriptions are cached; the cache is created on the first search, making that search slower than subsequent ones\. Display \fIformula\fR\'s name and one\-line description\. Formula descriptions are cached; the cache is created on the first search, making that search slower than subsequent ones\.
. .
......
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