mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
zsh/completions: add_cask_options
This commit is contained in:
parent
d820c9a919
commit
90ff41f451
@ -66,6 +66,19 @@ __brew_installed_formulae() {
|
|||||||
_describe -t formulae 'installed formulae' formulae
|
_describe -t formulae 'installed formulae' formulae
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__brew_all_casks() {
|
||||||
|
local -a list
|
||||||
|
local expl
|
||||||
|
local comp_cachename=brew_casks
|
||||||
|
|
||||||
|
if ! _retrieve_cache $comp_cachename; then
|
||||||
|
list=( $(brew search --cask) )
|
||||||
|
_store_cache $comp_cachename list
|
||||||
|
fi
|
||||||
|
|
||||||
|
_wanted list expl 'all casks' compadd -a list
|
||||||
|
}
|
||||||
|
|
||||||
__brew_installed_casks() {
|
__brew_installed_casks() {
|
||||||
local -a list
|
local -a list
|
||||||
local expl
|
local expl
|
||||||
@ -221,14 +234,19 @@ _brew_aspell_dictionaries() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# brew audit [--strict] [--online] [--new-formula] [--display-cop-names] [--display-filename] [formulae]
|
# brew audit [--strict] [--online] [--new-formula] [--display-cop-names] [--display-filename] [formulae]
|
||||||
|
# brew audit --cask [cask]
|
||||||
_brew_audit() {
|
_brew_audit() {
|
||||||
_arguments \
|
_arguments \
|
||||||
'(--new-formula)--strict[run additional checks including RuboCop style checks]' \
|
--formula-opts \
|
||||||
'(--new-formula)--online[run slower checks that require a network connection]' \
|
'(--new-formula)--strict[run additional checks including RuboCop style checks]' \
|
||||||
'(--online --strict)--new-formula[check if a new formula is eligible for Homebrew. Implies --strict and --online]' \
|
'(--new-formula)--online[run slower checks that require a network connection]' \
|
||||||
'--display-cop-names[include RuboCop cop name for each violation in the output]' \
|
'(--online --strict)--new-formula[check if a new formula is eligible for Homebrew. Implies --strict and --online]' \
|
||||||
'--display-filename[prefix every line of output with the name of the file or formula being audited]' \
|
'--display-cop-names[include RuboCop cop name for each violation in the output]' \
|
||||||
'*:formula:__brew_formulae_or_ruby_files'
|
'--display-filename[prefix every line of output with the name of the file or formula being audited]' \
|
||||||
|
'*:formula:__brew_formulae_or_ruby_files' \
|
||||||
|
--casks-opts \
|
||||||
|
'--cask[audit casks]' \
|
||||||
|
'*:: :__brew_all_casks' \
|
||||||
}
|
}
|
||||||
|
|
||||||
# brew bottle [--verbose] [--no-rebuild] [--keep-old] [--skip-relocation] [--root-url=root_url]
|
# brew bottle [--verbose] [--no-rebuild] [--keep-old] [--skip-relocation] [--root-url=root_url]
|
||||||
@ -425,10 +443,14 @@ _brew_home() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# brew info formulae
|
# brew info formulae
|
||||||
|
# brew info --cask cask
|
||||||
# brew info --github formula
|
# brew info --github formula
|
||||||
# brew info --json=version (--all|--installed|formulae)
|
# brew info --json=version (--all|--installed|formulae)
|
||||||
_brew_info() {
|
_brew_info() {
|
||||||
_arguments \
|
_arguments \
|
||||||
|
- cask-opts \
|
||||||
|
'--cask[get information on casks]' \
|
||||||
|
': :__brew_all_casks' \
|
||||||
- formulae-opts \
|
- formulae-opts \
|
||||||
'*: :__brew_formulae' \
|
'*: :__brew_formulae' \
|
||||||
- github-opts \
|
- github-opts \
|
||||||
@ -446,6 +468,7 @@ _brew_info() {
|
|||||||
# [--cc=compiler] [--build-from-source|--build-bottle|--force-fottle]
|
# [--cc=compiler] [--build-from-source|--build-bottle|--force-fottle]
|
||||||
# [--devel|--HEAD] [--fetch-HEAD] [--bottle-arch=architecture] [--keep-tmp] formulae
|
# [--devel|--HEAD] [--fetch-HEAD] [--bottle-arch=architecture] [--keep-tmp] formulae
|
||||||
# brew install --interactive [--git] formula
|
# brew install --interactive [--git] formula
|
||||||
|
# brew install --cask cask
|
||||||
_brew_install() {
|
_brew_install() {
|
||||||
local state
|
local state
|
||||||
_arguments \
|
_arguments \
|
||||||
@ -468,7 +491,10 @@ _brew_install() {
|
|||||||
- interactive-install \
|
- interactive-install \
|
||||||
'--interactive[download and patch formula, then open a shell]' \
|
'--interactive[download and patch formula, then open a shell]' \
|
||||||
'--git' \
|
'--git' \
|
||||||
': : __brew_formulae'
|
': : __brew_formulae' \
|
||||||
|
- cask-install \
|
||||||
|
'--cask[install casks]' \
|
||||||
|
': :__brew_all_casks' \
|
||||||
}
|
}
|
||||||
|
|
||||||
# brew irb [--examples]
|
# brew irb [--examples]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user