diff --git a/Library/Homebrew/cli/args.rbi b/Library/Homebrew/cli/args.rbi index 3ef5dcf0c5..5ff90c62c1 100644 --- a/Library/Homebrew/cli/args.rbi +++ b/Library/Homebrew/cli/args.rbi @@ -105,6 +105,12 @@ module Homebrew sig { returns(T::Boolean) } def installed?; end + sig { returns(T::Boolean) } + def installed_on_request?; end + + sig { returns(T::Boolean) } + def installed_as_dependency?; end + sig { returns(T::Boolean) } def all?; end diff --git a/completions/bash/brew b/completions/bash/brew index b742579eec..bd9cc25f84 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -1170,6 +1170,8 @@ _brew_leaves() { __brewcomp " --debug --help + --installed-as-dependency + --installed-on-request --quiet --verbose " diff --git a/completions/fish/brew.fish b/completions/fish/brew.fish index b71c079f23..ab79f62cf8 100644 --- a/completions/fish/brew.fish +++ b/completions/fish/brew.fish @@ -845,6 +845,8 @@ __fish_brew_complete_arg 'irb' -l verbose -d 'Make some output more verbose' __fish_brew_complete_cmd 'leaves' 'List installed formulae that are not dependencies of another installed formula' __fish_brew_complete_arg 'leaves' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'leaves' -l help -d 'Show this message' +__fish_brew_complete_arg 'leaves' -l installed-as-dependency -d 'Only list leaves that were installed as dependencies' +__fish_brew_complete_arg 'leaves' -l installed-on-request -d 'Only list leaves that were manually installed' __fish_brew_complete_arg 'leaves' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'leaves' -l verbose -d 'Make some output more verbose' diff --git a/completions/zsh/_brew b/completions/zsh/_brew index fe36e5cc0e..02b829b871 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -1037,6 +1037,8 @@ _brew_leaves() { _arguments \ '--debug[Display any debugging information]' \ '--help[Show this message]' \ + '(--installed-on-request)--installed-as-dependency[Only list leaves that were installed as dependencies]' \ + '(--installed-as-dependency)--installed-on-request[Only list leaves that were manually installed]' \ '--quiet[Make some output more quiet]' \ '--verbose[Make some output more verbose]' } diff --git a/docs/Manpage.md b/docs/Manpage.md index a340e167fb..2b39668187 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -313,10 +313,15 @@ the installed formulae or, every 30 days, for all formulae. * `--skip-cask-deps`: Skip installing cask dependencies. -### `leaves` +### `leaves` [*`--installed-on-request`*] [*`--installed-as-dependency`*] List installed formulae that are not dependencies of another installed formula. +* `-r`, `--installed-on-request`: + Only list leaves that were manually installed. +* `-p`, `--installed-as-dependency`: + Only list leaves that were installed as dependencies. + ### `link`, `ln` [*`options`*] *`installed_formula`* [...] Symlink all of *`formula`*'s installed files into Homebrew's prefix. This diff --git a/manpages/brew.1 b/manpages/brew.1 index 003aa3fb95..cab44faede 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -424,9 +424,17 @@ Disable/enable quarantining of downloads (default: enabled)\. \fB\-\-skip\-cask\-deps\fR Skip installing cask dependencies\. . -.SS "\fBleaves\fR" +.SS "\fBleaves\fR [\fI\-\-installed\-on\-request\fR] [\fI\-\-installed\-as\-dependency\fR]" List installed formulae that are not dependencies of another installed formula\. . +.TP +\fB\-r\fR, \fB\-\-installed\-on\-request\fR +Only list leaves that were manually installed\. +. +.TP +\fB\-p\fR, \fB\-\-installed\-as\-dependency\fR +Only list leaves that were installed as dependencies\. +. .SS "\fBlink\fR, \fBln\fR [\fIoptions\fR] \fIinstalled_formula\fR [\.\.\.]" Symlink all of \fIformula\fR\'s installed files into Homebrew\'s prefix\. This is done automatically when you install formulae but can be useful for DIY installations\. .