Skip to content

Commit b0c5f61

Browse files
Merge pull request #19929 from Homebrew/cask-shell-completions
cask: document shell completion stanzas
2 parents bb33840 + 0838ced commit b0c5f61

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Library/Homebrew/cask/artifact/shellcompletion.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
module Cask
77
module Artifact
88
class ShellCompletion < Symlinked
9-
sig { params(cask: Cask, source: T.any(String, Pathname)).returns(ShellCompletion) }
10-
def self.from_args(cask, source)
11-
new(cask, source)
12-
end
13-
149
sig { params(_: T.any(String, Pathname)).returns(Pathname) }
1510
def resolve_target(_)
1611
raise CaskInvalidError, "Shell completion without shell info"

Library/Homebrew/rubocops/cask/constants/stanza.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ module Constants
4040
:installer,
4141
:binary,
4242
:manpage,
43+
:bash_completion,
44+
:fish_completion,
45+
:zsh_completion,
4346
:colorpicker,
4447
:dictionary,
4548
:font,

docs/Cask-Cookbook.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ Having a common order for stanzas makes casks easier to update and parse. Below
6767
installer
6868
binary
6969
manpage
70+
bash_completion
71+
fish_completion
72+
zsh_completion
7073
colorpicker
7174
dictionary
7275
font
@@ -130,6 +133,9 @@ Each cask must declare one or more *artifacts* (i.e. something to install).
130133
| [`installer`](#stanza-installer) | yes | Describes an executable which must be run to complete the installation. |
131134
| [`binary`](#stanza-binary) | yes | Relative path to a Binary that should be linked into the `$(brew --prefix)/bin` folder on installation. |
132135
| `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`. |
136+
| `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. |
137+
| `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. |
138+
| `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. |
133139
| `colorpicker` | yes | Relative path to a ColorPicker plugin that should be moved into the `~/Library/ColorPickers` folder on installation. |
134140
| `dictionary` | yes | Relative path to a Dictionary that should be moved into the `~/Library/Dictionaries` folder on installation. |
135141
| `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
199205

200206
#### *target* works on most artifact types
201207

202-
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`.
208+
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`.
203209

204210
#### *target* should only be used in select cases
205211

0 commit comments

Comments
 (0)