Merge pull request #19929 from Homebrew/cask-shell-completions

cask: document shell completion stanzas
This commit is contained in:
Eric Knibbe 2025-05-10 17:17:43 +00:00 committed by GitHub
commit b0c5f613b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 6 deletions

View File

@ -6,11 +6,6 @@ require "cask/artifact/symlinked"
module Cask
module Artifact
class ShellCompletion < Symlinked
sig { params(cask: Cask, source: T.any(String, Pathname)).returns(ShellCompletion) }
def self.from_args(cask, source)
new(cask, source)
end
sig { params(_: T.any(String, Pathname)).returns(Pathname) }
def resolve_target(_)
raise CaskInvalidError, "Shell completion without shell info"

View File

@ -40,6 +40,9 @@ module RuboCop
:installer,
:binary,
:manpage,
:bash_completion,
:fish_completion,
:zsh_completion,
:colorpicker,
:dictionary,
:font,

View File

@ -67,6 +67,9 @@ Having a common order for stanzas makes casks easier to update and parse. Below
installer
binary
manpage
bash_completion
fish_completion
zsh_completion
colorpicker
dictionary
font
@ -130,6 +133,9 @@ Each cask must declare one or more *artifacts* (i.e. something to install).
| [`installer`](#stanza-installer) | yes | Describes an executable which must be run to complete the installation. |
| [`binary`](#stanza-binary) | yes | Relative path to a Binary that should be linked into the `$(brew --prefix)/bin` folder on installation. |
| `manpage` | yes | Relative path to a Man Page that should be linked into the respective man page folder on installation, e.g. `/opt/homebrew/share/man/man3` for `my_app.3`. |
| `bash_completion` | yes | Relative path to a Bash completion file that should be linked into the `$(brew --prefix)/etc/bash_completion.d` folder on installation. |
| `fish_completion` | yes | Relative path to a fish completion file that should be linked into the `$(brew --prefix)/share/fish/vendor_completions.d` folder on installation. |
| `zsh_completion` | yes | Relative path to a Zsh completion file that should be linked into the `$(brew --prefix)/share/zsh/site-functions` folder on installation. |
| `colorpicker` | yes | Relative path to a ColorPicker plugin that should be moved into the `~/Library/ColorPickers` folder on installation. |
| `dictionary` | yes | Relative path to a Dictionary that should be moved into the `~/Library/Dictionaries` folder on installation. |
| `font` | yes | Relative path to a Font that should be moved into the `~/Library/Fonts` folder on installation. |
@ -199,7 +205,7 @@ artifact "sapmachine-jdk-#{version}.jdk", target: "/Library/Java/JavaVirtualMach
#### *target* works on most artifact types
The `target:` key works similarly for most cask artifacts, such as `app`, `binary`, `colorpicker`, `dictionary`, `font`, `input_method`, `internet_plugin`, `keyboard_layout`, `prefpane`, `qlplugin`, `mdimporter`, `screen_saver`, `service`, `suite`, `audio_unit_plugin`, `vst_plugin`, `vst3_plugin`, and `artifact`.
The `target:` key works similarly for most cask artifacts, such as `app`, `binary`, `bash_completion`, `fish_completion`, `zsh_completion`, `colorpicker`, `dictionary`, `font`, `input_method`, `internet_plugin`, `keyboard_layout`, `prefpane`, `qlplugin`, `mdimporter`, `screen_saver`, `service`, `suite`, `audio_unit_plugin`, `vst_plugin`, `vst3_plugin`, and `artifact`.
#### *target* should only be used in select cases