From f97f7b615eecec83d7fee6c5d95948ea3e37c6ca Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Thu, 14 Mar 2019 16:44:17 -0400 Subject: [PATCH] deps: allow passing both --installed & --include-requirements And update docs. --- Library/Homebrew/cmd/deps.rb | 36 +++++++++++++++-------------- Library/Homebrew/requirement.rb | 1 + docs/Manpage.md | 31 ++++++++++++------------- manpages/brew.1 | 40 ++++++++++++++++----------------- 4 files changed, 56 insertions(+), 52 deletions(-) diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb index 7edaaaba88..8cc337bb36 100644 --- a/Library/Homebrew/cmd/deps.rb +++ b/Library/Homebrew/cmd/deps.rb @@ -10,40 +10,42 @@ module Homebrew usage_banner <<~EOS `deps` [] - Show dependencies for . When given multiple formula arguments, - show the intersection of dependencies for . + Show dependencies for . Additional options specific to + may be appended to the command. When given multiple formula arguments, + show the intersection of dependencies for each formula. EOS - switch "--1", - description: "Only show dependencies one level down, instead of recursing." switch "-n", description: "Show dependencies in topological order." + switch "--1", + description: "Only show dependencies one level down, instead of recursing." switch "--union", - description: "Show the union of dependencies for , instead of the intersection." + description: "Show the union of dependencies for multiple , instead of the intersection." switch "--full-name", description: "List dependencies by their full name." - switch "--installed", - description: "Only list those dependencies that are currently installed." - switch "--all", - description: "List all the dependencies for all available formulae." switch "--include-build", - description: "Show `:build` type dependencies for ." + description: "Include `:build` dependencies for ." switch "--include-optional", - description: "Show `:optional` dependencies for ." + description: "Include `:optional` dependencies for ." switch "--include-test", - description: "Show `:test` dependencies for (non-recursive)." + description: "Include `:test` dependencies for (non-recursive)." switch "--skip-recommended", - description: "Skip `:recommended` type dependencies for ." + description: "Skip `:recommended` dependencies for ." switch "--include-requirements", description: "Include requirements in addition to dependencies for ." switch "--tree", - description: "Show dependencies as a tree. When given multiple formula arguments "\ - "output individual trees for every formula." + description: "Show dependencies as a tree. When given multiple formula arguments, "\ + "show individual trees for each formula." switch "--annotate", description: "Mark any build, test, optional, or recommended dependencies as "\ "such in the output." + switch "--installed", + description: "List dependencies for formulae that are currently installed. If is "\ + "specified, list only its dependencies that are currently installed." + switch "--all", + description: "List dependencies for all available formulae." switch "--for-each", - description: "Switch into the mode used by `deps --all`, but only list dependencies "\ - "for specified formula one specified formula per line. This is used for "\ + description: "Switch into the mode used by the `--all` option, but only list dependencies "\ + "for the specified , one formula per line. This is used for "\ "debugging the `--installed`/`--all` display mode." switch :verbose switch :debug diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb index cdff3f254e..6b1e2fe8b1 100644 --- a/Library/Homebrew/requirement.rb +++ b/Library/Homebrew/requirement.rb @@ -60,6 +60,7 @@ class Requirement true end + alias installed? satisfied? # Overriding {#fatal?} is unsupported. # Pass a boolean to the fatal DSL method instead. diff --git a/docs/Manpage.md b/docs/Manpage.md index 1f6c9de108..9bb1e9789d 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -84,37 +84,38 @@ report, you will likely be asked for this information if you do not provide it. ### `deps` [*`options`*] *`formula`* -Show dependencies for *`formula`*. When given multiple formula arguments, show the -intersection of dependencies for *`formula`*. +Show dependencies for *`formula`*. Additional options specific to *`formula`* may be +appended to the command. When given multiple formula arguments, show the +intersection of dependencies for each formula. -* `--1`: - Only show dependencies one level down, instead of recursing. * `-n`: Show dependencies in topological order. +* `--1`: + Only show dependencies one level down, instead of recursing. * `--union`: - Show the union of dependencies for *`formula`*, instead of the intersection. + Show the union of dependencies for multiple *`formula`*, instead of the intersection. * `--full-name`: List dependencies by their full name. -* `--installed`: - Only list those dependencies that are currently installed. -* `--all`: - List all the dependencies for all available formulae. * `--include-build`: - Show `:build` type dependencies for *`formula`*. + Include `:build` dependencies for *`formula`*. * `--include-optional`: - Show `:optional` dependencies for *`formula`*. + Include `:optional` dependencies for *`formula`*. * `--include-test`: - Show `:test` dependencies for *`formula`* (non-recursive). + Include `:test` dependencies for *`formula`* (non-recursive). * `--skip-recommended`: - Skip `:recommended` type dependencies for *`formula`*. + Skip `:recommended` dependencies for *`formula`*. * `--include-requirements`: Include requirements in addition to dependencies for *`formula`*. * `--tree`: - Show dependencies as a tree. When given multiple formula arguments output individual trees for every formula. + Show dependencies as a tree. When given multiple formula arguments, show individual trees for each formula. * `--annotate`: Mark any build, test, optional, or recommended dependencies as such in the output. +* `--installed`: + List dependencies for formulae that are currently installed. If *`formula`* is specified, list only its dependencies that are currently installed. +* `--all`: + List dependencies for all available formulae. * `--for-each`: - Switch into the mode used by `deps --all`, but only list dependencies for specified formula one specified 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 the specified *`formula`*, one formula per line. This is used for debugging the `--installed`/`--all` display mode. ### `desc` [*`options`*] (*`text`*|`/`*`text`*`/`|*`formula`*) diff --git a/manpages/brew.1 b/manpages/brew.1 index 4dd6e9a912..f15edcf778 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -80,47 +80,39 @@ Include the aliases of internal commands\. Show Homebrew and system configuration useful for debugging\. If you file a bug report, you will likely be asked for this information if you do not provide it\. . .SS "\fBdeps\fR [\fIoptions\fR] \fIformula\fR" -Show dependencies for \fIformula\fR\. When given multiple formula arguments, show the intersection of dependencies for \fIformula\fR\. -. -.TP -\fB\-\-1\fR -Only show dependencies one level down, instead of recursing\. +Show dependencies for \fIformula\fR\. Additional options specific to \fIformula\fR may be appended to the command\. When given multiple formula arguments, show the intersection of dependencies for each formula\. . .TP \fB\-n\fR Show dependencies in topological order\. . .TP +\fB\-\-1\fR +Only show dependencies one level down, instead of recursing\. +. +.TP \fB\-\-union\fR -Show the union of dependencies for \fIformula\fR, instead of the intersection\. +Show the union of dependencies for multiple \fIformula\fR, instead of the intersection\. . .TP \fB\-\-full\-name\fR List dependencies by their full name\. . .TP -\fB\-\-installed\fR -Only list those dependencies that are currently installed\. -. -.TP -\fB\-\-all\fR -List all the dependencies for all available formulae\. -. -.TP \fB\-\-include\-build\fR -Show \fB:build\fR type dependencies for \fIformula\fR\. +Include \fB:build\fR dependencies for \fIformula\fR\. . .TP \fB\-\-include\-optional\fR -Show \fB:optional\fR dependencies for \fIformula\fR\. +Include \fB:optional\fR dependencies for \fIformula\fR\. . .TP \fB\-\-include\-test\fR -Show \fB:test\fR dependencies for \fIformula\fR (non\-recursive)\. +Include \fB:test\fR dependencies for \fIformula\fR (non\-recursive)\. . .TP \fB\-\-skip\-recommended\fR -Skip \fB:recommended\fR type dependencies for \fIformula\fR\. +Skip \fB:recommended\fR dependencies for \fIformula\fR\. . .TP \fB\-\-include\-requirements\fR @@ -128,15 +120,23 @@ Include requirements in addition to dependencies for \fIformula\fR\. . .TP \fB\-\-tree\fR -Show dependencies as a tree\. When given multiple formula arguments output individual trees for every formula\. +Show dependencies as a tree\. When given multiple formula arguments, show individual trees for each formula\. . .TP \fB\-\-annotate\fR Mark any build, test, optional, or recommended dependencies as such in the output\. . .TP +\fB\-\-installed\fR +List dependencies for formulae that are currently installed\. If \fIformula\fR is specified, list only its dependencies that are currently installed\. +. +.TP +\fB\-\-all\fR +List dependencies for all available formulae\. +. +.TP \fB\-\-for\-each\fR -Switch into the mode used by \fBdeps \-\-all\fR, but only list dependencies for specified formula one specified 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 the specified \fIformula\fR, one formula per line\. This is used for debugging the \fB\-\-installed\fR/\fB\-\-all\fR display mode\. . .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\.