From 51a260cf1cb467265b645f2ed7a99e7ac76fee12 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 30 Jan 2019 13:18:02 +0000 Subject: [PATCH] deps: accept formula options. Also, cleanup usage of ``. As requested in comments of #5587. --- Library/Homebrew/cmd/deps.rb | 34 +++++++++++++++++++--------------- docs/Manpage.md | 15 +++++++++------ manpages/brew.1 | 13 ++++++++----- 3 files changed, 36 insertions(+), 26 deletions(-) diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb index dd51f8913be65..e4d661659d6ba 100644 --- a/Library/Homebrew/cmd/deps.rb +++ b/Library/Homebrew/cmd/deps.rb @@ -1,13 +1,13 @@ -#: * `deps` [`--1`] [`-n`] [`--union`] [`--full-name`] [`--installed`] [`--include-build`] [`--include-optional`] [`--skip-recommended`] [`--include-requirements`] : -#: Show dependencies for . When given multiple formula arguments, -#: show the intersection of dependencies for . +#: * `deps` [`--1`] [`-n`] [`--union`] [`--full-name`] [`--installed`] [`--include-build`] [`--include-optional`] [`--skip-recommended`] [`--include-requirements`] : +#: Show dependencies for . When given multiple formula arguments, +#: show the intersection of dependencies for every formula. #: #: If `--1` is passed, only show dependencies one level down, instead of #: recursing. #: #: If `-n` is passed, show dependencies in topological order. #: -#: If `--union` is passed, show the union of dependencies for , +#: If `--union` is passed, show the union of dependencies for , #: instead of the intersection. #: #: If `--full-name` is passed, list dependencies by their full name. @@ -16,13 +16,13 @@ #: currently installed. #: #: By default, `deps` shows required and recommended dependencies for -#: . To include the `:build` type dependencies, pass `--include-build`. +#: . To include the `:build` type dependencies, pass `--include-build`. #: Similarly, pass `--include-optional` to include `:optional` dependencies or #: `--include-test` to include (non-recursive) `:test` dependencies. #: To skip `:recommended` type dependencies, pass `--skip-recommended`. #: To include requirements in addition to dependencies, pass `--include-requirements`. #: -#: * `deps` `--tree` [`--1`] [] [`--annotate`] (|`--installed`): +#: * `deps` `--tree` [`--1`] [] [`--annotate`] (|`--installed`): #: Show dependencies as a tree. When given multiple formula arguments, output #: individual trees for every formula. #: @@ -45,6 +45,9 @@ #: The placeholder is any combination of options `--include-build`, #: `--include-optional`, `--include-test`, and `--skip-recommended` as #: documented above. +#: +#: Additional options specific to may be appended to the command, +#: and can be listed with `brew options` . # The undocumented `--for-each` option will switch into the mode used by `deps --all`, # but only list dependencies for specified formula, one specified formula per line. @@ -62,17 +65,17 @@ module Homebrew def deps_args Homebrew::CLI::Parser.new do usage_banner <<~EOS - `deps` [] + `deps` [] - Show dependencies for . When given multiple formula arguments, - show the intersection of dependencies for . + Show dependencies for . When given multiple formula arguments, + show the intersection of dependencies for . EOS switch "--1", description: "Only show dependencies one level down, instead of recursing." switch "-n", description: "Show dependencies in topological order." switch "--union", - description: "Show the union of dependencies for , instead of the intersection." + description: "Show the union of dependencies for , instead of the intersection." switch "--full-name", description: "List dependencies by their full name." switch "--installed", @@ -80,15 +83,15 @@ def deps_args switch "--all", description: "List all the dependencies for all available formuale." switch "--include-build", - description: "Show `:build` type dependencies for ." + description: "Show `:build` type dependencies for ." switch "--include-optional", - description: "Show `:optional` dependecies for ." + description: "Show `:optional` dependecies for ." switch "--include-test", - description: "Show `:test` dependencies for (non-recursive)." + description: "Show `:test` dependencies for (non-recursive)." switch "--skip-recommended", - description: "Skip `:recommended` type dependencies for ." + description: "Skip `:recommended` type dependencies for ." switch "--include-requirements", - description: "Include requirements in addition to dependencies for ." + 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." @@ -99,6 +102,7 @@ def deps_args switch :verbose switch :debug conflicts "--installed", "--all" + formula_options end end diff --git a/docs/Manpage.md b/docs/Manpage.md index c7e86cb8a77bd..0e9dcfdc090d1 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -79,16 +79,16 @@ these flags should only appear after a command. a bug report, you will likely be asked for this information if you do not provide it. - * `deps` [`--1`] [`-n`] [`--union`] [`--full-name`] [`--installed`] [`--include-build`] [`--include-optional`] [`--skip-recommended`] [`--include-requirements`] *`formulae`*: - Show dependencies for *`formulae`*. When given multiple formula arguments, - show the intersection of dependencies for *`formulae`*. + * `deps` [`--1`] [`-n`] [`--union`] [`--full-name`] [`--installed`] [`--include-build`] [`--include-optional`] [`--skip-recommended`] [`--include-requirements`] *`formula`*: + Show dependencies for *`formula`*. When given multiple formula arguments, + show the intersection of dependencies for every formula. If `--1` is passed, only show dependencies one level down, instead of recursing. If `-n` is passed, show dependencies in topological order. - If `--union` is passed, show the union of dependencies for *`formulae`*, + If `--union` is passed, show the union of dependencies for *`formula`*, instead of the intersection. If `--full-name` is passed, list dependencies by their full name. @@ -97,13 +97,13 @@ these flags should only appear after a command. currently installed. By default, `deps` shows required and recommended dependencies for - *`formulae`*. To include the `:build` type dependencies, pass `--include-build`. + *`formula`*. To include the `:build` type dependencies, pass `--include-build`. Similarly, pass `--include-optional` to include `:optional` dependencies or `--include-test` to include (non-recursive) `:test` dependencies. To skip `:recommended` type dependencies, pass `--skip-recommended`. To include requirements in addition to dependencies, pass `--include-requirements`. - * `deps` `--tree` [`--1`] [*`filters`*] [`--annotate`] (*`formulae`*|`--installed`): + * `deps` `--tree` [`--1`] [*`filters`*] [`--annotate`] (*`formula`*|`--installed`): Show dependencies as a tree. When given multiple formula arguments, output individual trees for every formula. @@ -127,6 +127,9 @@ these flags should only appear after a command. `--include-optional`, `--include-test`, and `--skip-recommended` as documented above. + Additional options specific to *`formula`* may be appended to the command, + and can be listed with `brew options` *`formula`*. + * `desc` *`formula`*: Display *`formula`*'s name and one-line description. diff --git a/manpages/brew.1 b/manpages/brew.1 index 00fcb0a118305..0998c376f2807 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -88,8 +88,8 @@ If \fB\-\-quiet\fR is passed, list only the names of commands without the header 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\. . .TP -\fBdeps\fR [\fB\-\-1\fR] [\fB\-n\fR] [\fB\-\-union\fR] [\fB\-\-full\-name\fR] [\fB\-\-installed\fR] [\fB\-\-include\-build\fR] [\fB\-\-include\-optional\fR] [\fB\-\-skip\-recommended\fR] [\fB\-\-include\-requirements\fR] \fIformulae\fR -Show dependencies for \fIformulae\fR\. When given multiple formula arguments, show the intersection of dependencies for \fIformulae\fR\. +\fBdeps\fR [\fB\-\-1\fR] [\fB\-n\fR] [\fB\-\-union\fR] [\fB\-\-full\-name\fR] [\fB\-\-installed\fR] [\fB\-\-include\-build\fR] [\fB\-\-include\-optional\fR] [\fB\-\-skip\-recommended\fR] [\fB\-\-include\-requirements\fR] \fIformula\fR +Show dependencies for \fIformula\fR\. When given multiple formula arguments, show the intersection of dependencies for every formula\. . .IP If \fB\-\-1\fR is passed, only show dependencies one level down, instead of recursing\. @@ -98,7 +98,7 @@ If \fB\-\-1\fR is passed, only show dependencies one level down, instead of recu If \fB\-n\fR is passed, show dependencies in topological order\. . .IP -If \fB\-\-union\fR is passed, show the union of dependencies for \fIformulae\fR, instead of the intersection\. +If \fB\-\-union\fR is passed, show the union of dependencies for \fIformula\fR, instead of the intersection\. . .IP If \fB\-\-full\-name\fR is passed, list dependencies by their full name\. @@ -107,10 +107,10 @@ If \fB\-\-full\-name\fR is passed, list dependencies by their full name\. If \fB\-\-installed\fR is passed, only list those dependencies that are currently installed\. . .IP -By default, \fBdeps\fR shows required and recommended dependencies for \fIformulae\fR\. To include the \fB:build\fR type dependencies, pass \fB\-\-include\-build\fR\. Similarly, pass \fB\-\-include\-optional\fR to include \fB:optional\fR dependencies or \fB\-\-include\-test\fR to include (non\-recursive) \fB:test\fR dependencies\. To skip \fB:recommended\fR type dependencies, pass \fB\-\-skip\-recommended\fR\. To include requirements in addition to dependencies, pass \fB\-\-include\-requirements\fR\. +By default, \fBdeps\fR shows required and recommended dependencies for \fIformula\fR\. To include the \fB:build\fR type dependencies, pass \fB\-\-include\-build\fR\. Similarly, pass \fB\-\-include\-optional\fR to include \fB:optional\fR dependencies or \fB\-\-include\-test\fR to include (non\-recursive) \fB:test\fR dependencies\. To skip \fB:recommended\fR type dependencies, pass \fB\-\-skip\-recommended\fR\. To include requirements in addition to dependencies, pass \fB\-\-include\-requirements\fR\. . .TP -\fBdeps\fR \fB\-\-tree\fR [\fB\-\-1\fR] [\fIfilters\fR] [\fB\-\-annotate\fR] (\fIformulae\fR|\fB\-\-installed\fR) +\fBdeps\fR \fB\-\-tree\fR [\fB\-\-1\fR] [\fIfilters\fR] [\fB\-\-annotate\fR] (\fIformula\fR|\fB\-\-installed\fR) Show dependencies as a tree\. When given multiple formula arguments, output individual trees for every formula\. . .IP @@ -132,6 +132,9 @@ Show dependencies for installed or all available formulae\. Every line of output .IP The \fIfilters\fR placeholder is any combination of options \fB\-\-include\-build\fR, \fB\-\-include\-optional\fR, \fB\-\-include\-test\fR, and \fB\-\-skip\-recommended\fR as documented above\. . +.IP +Additional options specific to \fIformula\fR may be appended to the command, and can be listed with \fBbrew options\fR \fIformula\fR\. +. .TP \fBdesc\fR \fIformula\fR Display \fIformula\fR\'s name and one\-line description\.