-
Notifications
You must be signed in to change notification settings - Fork 4
/
brew-cask.fish
158 lines (118 loc) · 7.03 KB
/
brew-cask.fish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Fish completion script for brew-cask(1)
function __fish_brew_cask_needs_command
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 -a $cmd[1] = 'brew-cask' ]
return 0
end
return 1
end
function __fish_brew_cask_using_command
set cmd (commandline -opc)
if [ (count $cmd) -gt 1 ]
if [ $argv[1] = $cmd[2] ]
return 0
end
end
return 1
end
function __fish_brew_cask_casks
find (brew --repository)/Library/Taps/caskroom/homebrew-cask/Casks -name "*.rb" -print | sed 's/.rb$//' | sed "s|^.*/||"
end
function __fish_brew_cask_caskroom
ls /opt/homebrew-cask/Caskroom/
end
function __fish_brew_cask_installed_casks
brew-cask list -1
end
############
# commands #
############
# alfred
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a alfred -d 'Displays note about new built-in alfred support'
# audit
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a audit -d 'Check casks'
complete -f -c brew-cask -n '__fish_brew_cask_using_command audit' -a '(__fish_brew_cask_casks)'
# cat
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a cat -d 'Display cask'
complete -f -c brew-cask -n '__fish_brew_cask_using_command cat' -a '(__fish_brew_cask_casks)'
# cleanup
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a cleanup -d 'Clean up cached downloads and tracker symlinks'
complete -f -c brew-cask -n '__fish_brew_cask_using_command cleanup' -l outdated -d 'Only clean up cached downloads older than 10 days old'
complete -f -c brew-cask -n '__fish_brew_cask_using_command cleanup' -a '(__fish_brew_cask_installed_casks)'
# create
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a create -d 'Generate a Cask definition file'
# doctor
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a 'doctor dr' -d 'Check for configuration issues'
# edit
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a 'edit' -d 'Open cask definition file for editing'
complete -f -c brew-cask -n '__fish_brew_cask_using_command edit' -a '(__fish_brew_cask_casks)'
# fetch
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a fetch -d 'Download resources for cask'
complete -f -c brew-cask -n '__fish_brew_cask_using_command fetch' -l force -d 'Force re-download even if the resources are already cached'
complete -f -c brew-cask -n '__fish_brew_cask_using_command fetch' -a '(__fish_brew_cask_casks)'
# help
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a 'help' -d 'Display help'
# home
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a 'home homepage' -d 'Open cask\'s homepage'
complete -c brew-cask -n '__fish_brew_cask_using_command home' -a '(__fish_brew_cask_casks)'
# info
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a 'info abv' -d 'Display information about cask'
complete -c brew-cask -n '__fish_brew_cask_using_command info' -a '(__fish_brew_cask_casks)'
# install
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a 'install' -d 'Install cask'
complete -f -c brew-cask -n '__fish_brew_cask_using_command install' -l force -d 'Force install'
complete -c brew-cask -n '__fish_brew_cask_using_command install' -a '(__fish_brew_cask_casks)'
# list
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a 'list ls' -d 'List all installed casks'
complete -f -c brew-cask -n '__fish_brew_cask_using_command list' -s 1 -d 'Always format the output in a single column'
complete -f -c brew-cask -n '__fish_brew_cask_using_command ls' -s 1 -d 'Always format the output in a single column'
complete -f -c brew-cask -n '__fish_brew_cask_using_command list' -s l -d 'Give a more detailed listing'
complete -f -c brew-cask -n '__fish_brew_cask_using_command ls' -s l -d 'Give a more detailed listing'
complete -c brew-cask -n '__fish_brew_cask_using_command list' -a '(__fish_brew_cask_casks)'
complete -c brew-cask -n '__fish_brew_cask_using_command ls' -a '(__fish_brew_cask_casks)'
# search
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a 'search -S' -d 'Display all casks or search by name'
# uninstall
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a 'uninstall remove rm' -d 'Uninstall cask'
complete -f -c brew-cask -n '__fish_brew_cask_using_command uninstall' -a '(__fish_brew_cask_installed_casks)'
complete -f -c brew-cask -n '__fish_brew_cask_using_command remove' -a '(__fish_brew_cask_installed_casks)'
complete -f -c brew-cask -n '__fish_brew_cask_using_command rm' -a '(__fish_brew_cask_installed_casks)'
complete -f -c brew-cask -n '__fish_brew_cask_using_command uninstall' -l force -d 'Uninstall even cask not present'
complete -f -c brew-cask -n '__fish_brew_cask_using_command remove' -l force -d 'Uninstall even cask not present'
complete -f -c brew-cask -n '__fish_brew_cask_using_command rm' -l force -d 'Uninstall even cask not present'
# zap
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -a zap -d 'Unconditionally remove all files associated with casks'
complete -c brew-cask -n '__fish_brew_cask_using_command zap' -a '(__fish_brew_cask_caskroom)'
############
# switches #
############
# --force
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -l force -d 'Force install cask even exists'
# --caskroom
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -l caskroom -d 'Location of the Caskroom, where all binaries are stored'
# --verbose
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -l verbose -d 'Give additional feedback during installation'
# --appdir
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -l appdir -d 'Target location for Application links'
# --colorpickerdir
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -l appdir -d 'Target location for Color Picker links'
# --prefpanedir
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -l prefpanedir -d 'Target location for Preference Pane links'
# --qlplugindir
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -l qlplugindir -d 'Target location for QuickLook Plugin links'
# --fontdir
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -l fontdir -d 'Target location for Font links'
# --servicedir
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -l servicedir -d 'Target location for Service links'
# --input_methoddir
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -l input_methoddir -d 'Target location for Input Method links'
# --internet_plugindir
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -l internet_plugindir -d 'Target location for Internet Plugin links'
# --screen_saverdir
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -l screen_saverdir -d 'Target location for Screen Saver links'
# --no-binaries
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -l no-binaries -d 'Do not link ahelpera executables to /usr/local/bin'
# --binarydir
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -l binarydir -d 'Target location for ahelpera executable links'
# --debug
complete -f -c brew-cask -n '__fish_brew_cask_needs_command' -l debug -d 'Output debugging information'