From 6fdcab5abcffbbb0a3a734e1db7d7afe6cac753a Mon Sep 17 00:00:00 2001 From: Martin Afanasjew Date: Sun, 1 May 2016 17:09:42 +0200 Subject: deps: split and clarify documentation `brew deps` has three different modes of operation that were not easy to infer from the existing documentation. Split the help text into three parts to make this clearer. This also improves on the confusion when options were silently ignored because they don't apply to a certain mode of operation. Those are: 1. List the shared dependencies (either intersection or union) of explicitly named formulae with options for traversal depth/order. 2. Output separate trees of explicitly listed or all installed formulae. 3. List all available/installed formulae and their direct dependencies with one line per formula formatted as `: `. Closes #137. Closes #179. Signed-off-by: Martin Afanasjew --- Library/Homebrew/cmd/deps.rb | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb index 7a6b0a1e5..4c5dbb932 100644 --- a/Library/Homebrew/cmd/deps.rb +++ b/Library/Homebrew/cmd/deps.rb @@ -1,7 +1,6 @@ -#: * `deps` [`--1`] [`-n`] [`--union`] [`--tree`] [`--all`] [`--installed`] [`--include-build`] [`--include-optional`] [`--skip-recommended`] : +#: * `deps` [`--1`] [`-n`] [`--union`] [`--installed`] [`--include-build`] [`--include-optional`] [`--skip-recommended`] : #: Show dependencies for . When given multiple formula arguments, -#: show the intersection of dependencies for , except when passed -#: `--tree`, `--all`, or `--installed`. +#: show the intersection of dependencies for . #: #: If `--1` is passed, only show dependencies one level down, instead of #: recursing. @@ -11,16 +10,30 @@ #: If `--union` is passed, show the union of dependencies for , #: instead of the intersection. #: -#: If `--tree` is passed, show dependencies as a tree. -#: -#: If `--all` is passed, show dependencies for all formulae. -#: -#: If `--installed` is passed, show dependencies for all installed formulae. +#: If `--installed` is passed, only list those dependencies that are +#: currently installed. #: #: By default, `deps` shows required and recommended dependencies for #: . To include the `:build` type dependencies, pass `--include-build`. #: Similarly, pass `--include-optional` to include `:optional` dependencies. #: To skip `:recommended` type dependencies, pass `--skip-recommended`. +#: +#: * `deps` `--tree` [] (|`--installed`): +#: Show dependencies as a tree. When given multiple formula arguments, output +#: individual trees for every formula. +#: +#: If `--installed` is passed, output a tree for every installed formula. +#: +#: The placeholder is any combination of options `--include-build`, +#: `--include-optional`, and `--skip-recommended` as documented above. +#: +#: * `deps` [] (`--installed`|`--all`): +#: Show dependencies for installed or all available formulae. Every line of +#: output starts with the formula name, followed by a colon and all direct +#: dependencies of that formula. +#: +#: The placeholder is any combination of options `--include-build`, +#: `--include-optional`, and `--skip-recommended` as documented above. # encoding: UTF-8 require "formula" -- cgit v1.2.3