diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb index 85b42749d3..01bb6512f7 100644 --- a/Library/Homebrew/cmd/deps.rb +++ b/Library/Homebrew/cmd/deps.rb @@ -22,10 +22,10 @@ module Homebrew may be appended to the command. When given multiple formula arguments, show the intersection of dependencies for each formula. EOS - switch "-n", + switch "-n", "--topological", description: "Sort dependencies in topological order." - switch "--1", - description: "Only show dependencies one level down, instead of recursing." + switch "-1", "--direct", "--declared", "--1", + description: "Show only the direct dependencies declared in the formula." switch "--union", description: "Show the union of dependencies for multiple , instead of the intersection." switch "--full-name", @@ -81,7 +81,7 @@ module Homebrew Formulary.enable_factory_cache! - recursive = !args.send(:"1?") + recursive = !args.direct? installed = args.installed? || dependents(args.named.to_formulae_and_casks).all?(&:any_version_installed?) @use_runtime_dependencies = installed && recursive && @@ -149,7 +149,7 @@ module Homebrew condense_requirements(all_deps, args: args) all_deps.map! { |d| dep_display_name(d, args: args) } all_deps.uniq! - all_deps.sort! unless args.n? + all_deps.sort! unless args.topological? puts all_deps end diff --git a/completions/bash/brew b/completions/bash/brew index c124dd0e05..4d918ab053 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -728,11 +728,11 @@ _brew_deps() { case "${cur}" in -*) __brewcomp " - --1 --all --annotate --cask --debug + --direct --dot --for-each --formula @@ -746,10 +746,10 @@ _brew_deps() { --installed --quiet --skip-recommended + --topological --tree --union --verbose - -n " return ;; diff --git a/completions/fish/brew.fish b/completions/fish/brew.fish index 5104ca09e5..7629c67255 100644 --- a/completions/fish/brew.fish +++ b/completions/fish/brew.fish @@ -565,11 +565,11 @@ __fish_brew_complete_arg 'create' -l verbose -d 'Make some output more verbose' __fish_brew_complete_cmd 'deps' 'Show dependencies for formula' -__fish_brew_complete_arg 'deps' -l 1 -d 'Only show dependencies one level down, instead of recursing' __fish_brew_complete_arg 'deps' -l all -d 'List dependencies for all available formulae' __fish_brew_complete_arg 'deps' -l annotate -d 'Mark any build, test, optional, or recommended dependencies as such in the output' __fish_brew_complete_arg 'deps' -l cask -d 'Treat all named arguments as casks' __fish_brew_complete_arg 'deps' -l debug -d 'Display any debugging information' +__fish_brew_complete_arg 'deps' -l direct -d 'Show only the direct dependencies declared in the formula' __fish_brew_complete_arg 'deps' -l dot -d 'Show text-based graph description in DOT format' __fish_brew_complete_arg 'deps' -l for-each -d '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' __fish_brew_complete_arg 'deps' -l formula -d 'Treat all named arguments as formulae' @@ -583,10 +583,10 @@ __fish_brew_complete_arg 'deps' -l include-test -d 'Include `:test` dependencies __fish_brew_complete_arg 'deps' -l installed -d 'List dependencies for formulae that are currently installed. If formula is specified, list only its dependencies that are currently installed' __fish_brew_complete_arg 'deps' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'deps' -l skip-recommended -d 'Skip `:recommended` dependencies for formula' +__fish_brew_complete_arg 'deps' -l topological -d 'Sort dependencies in topological order' __fish_brew_complete_arg 'deps' -l tree -d 'Show dependencies as a tree. When given multiple formula arguments, show individual trees for each formula' __fish_brew_complete_arg 'deps' -l union -d 'Show the union of dependencies for multiple formula, instead of the intersection' __fish_brew_complete_arg 'deps' -l verbose -d 'Make some output more verbose' -__fish_brew_complete_arg 'deps' -l n -d 'Sort dependencies in topological order' __fish_brew_complete_arg 'deps; and not __fish_seen_argument -l cask -l casks' -a '(__fish_brew_suggest_formulae_all)' __fish_brew_complete_arg 'deps; and not __fish_seen_argument -l formula -l formulae' -a '(__fish_brew_suggest_casks_all)' diff --git a/completions/zsh/_brew b/completions/zsh/_brew index 4b349d5ada..959c2e0d03 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -695,10 +695,10 @@ _brew_create() { # brew deps _brew_deps() { _arguments \ - '--1[Only show dependencies one level down, instead of recursing]' \ '(--installed)--all[List dependencies for all available formulae]' \ '--annotate[Mark any build, test, optional, or recommended dependencies as such in the output]' \ '--debug[Display any debugging information]' \ + '--direct[Show only the direct dependencies declared in the formula]' \ '--dot[Show text-based graph description in DOT format]' \ '--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]' \ '--full-name[List dependencies by their full name]' \ @@ -711,10 +711,10 @@ _brew_deps() { '(--all)--installed[List dependencies for formulae that are currently installed. If formula is specified, list only its dependencies that are currently installed]' \ '--quiet[Make some output more quiet]' \ '--skip-recommended[Skip `:recommended` dependencies for formula]' \ + '--topological[Sort dependencies in topological order]' \ '(--graph)--tree[Show dependencies as a tree. When given multiple formula arguments, show individual trees for each formula]' \ '--union[Show the union of dependencies for multiple formula, instead of the intersection]' \ '--verbose[Make some output more verbose]' \ - '-n[Sort dependencies in topological order]' \ - formula \ '(--cask)--formula[Treat all named arguments as formulae]' \ '*::formula:__brew_formulae' \ diff --git a/docs/Manpage.md b/docs/Manpage.md index f30d1d1bed..1569289ccc 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -140,10 +140,10 @@ 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. -* `-n`: +* `-n`, `--topological`: Sort dependencies in topological order. -* `--1`: - Only show dependencies one level down, instead of recursing. +* `-1`, `--direct`: + Show only the direct dependencies declared in the formula. * `--union`: Show the union of dependencies for multiple *`formula`*, instead of the intersection. * `--full-name`: diff --git a/manpages/brew.1 b/manpages/brew.1 index 4c568bb1c6..d9a2e5f67b 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -154,12 +154,12 @@ Show Homebrew and system configuration info useful for debugging\. If you file a 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 +\fB\-n\fR, \fB\-\-topological\fR Sort dependencies in topological order\. . .TP -\fB\-\-1\fR -Only show dependencies one level down, instead of recursing\. +\fB\-1\fR, \fB\-\-direct\fR +Show only the direct dependencies declared in the formula\. . .TP \fB\-\-union\fR