Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bash completion: Avoid cask deprecation warnings, learn --cask #8710

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions completions/bash/brew
Expand Up @@ -312,7 +312,7 @@ _brew_link() {
}

_brew_list() {
local allopts="--unbrewed --verbose --pinned --versions --multiple"
local allopts="--unbrewed --verbose --pinned --versions --multiple --cask"
local cur="${COMP_WORDS[COMP_CWORD]}"

case "$cur" in
Expand Down Expand Up @@ -408,7 +408,7 @@ _brew_outdated() {
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
-*)
__brewcomp "--quiet --json=v1 --fetch-HEAD"
__brewcomp "--quiet --cask --json=v1 --fetch-HEAD"
return
;;
esac
Expand Down Expand Up @@ -578,6 +578,7 @@ _brew_upgrade() {
--all
--build-from-source --build-bottle --force-bottle
--cleanup
--cask
--debug
--verbose
--fetch-HEAD
Expand Down Expand Up @@ -656,7 +657,7 @@ __brew_cask_complete_formulae ()
__brew_cask_complete_installed ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
local inst=$(brew cask list -1)
local inst=$(brew list --cask -1)
COMPREPLY=($(compgen -W "$inst" -- "$cur"))
}

Expand All @@ -672,7 +673,7 @@ __brew_cask_complete_outdated ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
local greedy=$(__brew_caskcomp_words_include "--greedy" && echo "--greedy")
local outdated=$(brew cask outdated --quiet $greedy)
local outdated=$(brew outdated --cask --quiet $greedy)
COMPREPLY=($(compgen -W "$outdated" -- "$cur"))
}

Expand Down