fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Fabian Boehmcompletions/wine: Complete files86e531b84

master
13.7 KiB394 linesraw
1function __fish_wine_explorer__complete_desktop_arg
2    set -l current_token (commandline -tc)
3
4    switch "$current_token"
5        case '/desktop=*x*'
6            return
7        case '/desktop=*'
8            printf '%sx' "$current_token"
9    end
10end
11
12function __fish_msiexec__option_completion_condition
13    set -l token (commandline -oc)[3]
14
15    not string match --quiet --regex '^/(uninstall|[ipyz])$|^/[fjql]' -- "$token"
16end
17
18function __fish_msiexec_complete_option_arg
19    set -l current_token (commandline -tc)
20
21    switch "$current_token"
22        case '/f*'
23            set values 'p\tReinstall the file if it is missing' \
24                'o\tReinstall the file if it is missing or if any older version is installed' \
25                'e\tReinstall the file if it is missing, or if the installed version is equal or older' \
26                'd\tReinstall the file if it is missing or a different version is installed' \
27                'c\tReinstall the file if it is missing or the checksum does not match' \
28                'a\tReinstall all files' \
29                'u\tRewrite all required user registry entries' \
30                'm\tRewrite all required machine registry entries' \
31                's\tOverwrite any conflicting shortcuts' \
32                'v\tRecache the local installation package from the source installation package'
33
34        case '/q*'
35            set values 'n\tDisable UI' \
36                'b\tShow the basic UI' \
37                'r\tShow the reduced UI' \
38                'f\tShow the full UI'
39
40        case '/l*'
41            set values '*\tEnable all options except v and x' \
42                'i\tEnable status messages' \
43                'w\tEnable warning messages' \
44                'e\tEnable error messages' \
45                'a\tEnable messages for action startups' \
46                'r\tEnable messages for action records' \
47                'u\tEnable messages for user requests' \
48                'c\tEnable messages for initial UI parameters' \
49                'm\tEnable messages for out of memory errors' \
50                'o\tEnable messages for out of disk space errors' \
51                'p\tEnable messages for terminal properties' \
52                'v\tEnable verbose messages' \
53                'x\tEnable messages for debugging' \
54                '+\tAppend messages to a file' \
55                '!\tFlush each line of messages'
56    end
57
58    for value in $values
59        echo -e "$current_token$value"
60    end
61end
62
63function __fish_wine__complete_cmd_subcommand --argument-names command
64    set -l condition '__fish_seen_subcommand_from cmd'
65    complete -c $command -a '(__fish_cmd__complete_args)' -n $condition
66
67    set -l c_and_k_condition 'not __fish_seen_argument -w c -w k'
68
69    complete -c $command -a /c \
70        -d 'Run the command and stop' \
71        -n "$condition && $c_and_k_condition"
72
73    complete -c $command -a /k \
74        -d 'Run the command and continue' \
75        -n "$condition && $c_and_k_condition"
76
77    complete -c $command -a /s \
78        -d 'Modify the treatment of string after /c or /k' \
79        -n $condition
80
81    complete -c $command -a /q -d 'Turn echo off' -n $condition
82
83    complete -c $command -a /d \
84        -d 'Disable execution of AutoRun commands' \
85        -n $condition
86
87    set -l a_and_u_condition 'not __fish_seen_argument -w a -w u'
88
89    complete -c $command -a /a \
90        -d 'Format internal command output as ANSI' \
91        -n "$condition && $a_and_u_condition"
92
93    complete -c $command -a /u \
94        -d 'Format internal command output as Unicode' \
95        -n "$condition && $a_and_u_condition"
96
97    complete -c $command -a /t \
98        -d 'Set the background and foreground color' \
99        -n $condition
100
101    complete -c $command -a /e -d 'Manage command extensions' -n $condition
102
103    complete -c $command -a /f \
104        -d 'Manage file and directory name completion' \
105        -n $condition
106
107    complete -c $command -a /v \
108        -d 'Manage delayed environment variable expansion' \
109        -n $condition
110
111    complete -c $command -a '/?' -d 'Show help' -n $condition
112end
113
114function __fish_wine__complete_control_subcommand --argument-names command
115    set -l condition '__fish_seen_subcommand_from control'
116
117    complete -c $command \
118        -a 'COLOR DATE/TIME DESKTOP INTERNATIONAL KEYBOARD MOUSE PORTS PRINTERS' \
119        -n $condition
120end
121
122function __fish_wine__complete_eject_subcommand --argument-names command
123    set -l condition '__fish_seen_subcommand_from eject'
124    complete -c $command -s h -d 'Show help' -n $condition
125    complete -c $command -s a -d 'Eject all the CD drives' -n $condition
126    complete -c $command -s u -d 'Unmount the CD drives' -n $condition
127end
128
129function __fish_wine__complete_explorer_subcommand --argument-names command
130    set -l condition '__fish_seen_subcommand_from explorer'
131
132    complete -c $command -a '(__fish_wine_explorer__complete_desktop_arg)' \
133        -n $condition
134
135    complete -c $command -a /n -d 'Use the single pain view' -n $condition
136    complete -c $command -a /e, -d 'Use the default view' -n $condition
137
138    complete -c $command -a /root, -d 'Specify the root level of a view' \
139        -n $condition
140
141    complete -c $command -a /select, -d 'Specify the selection in a view' \
142        -n $condition
143
144    complete -c $command -a /desktop= -d 'Specify the desktop name' \
145        -n $condition
146end
147
148function __fish_wine__complete_msiexec_subcommand --argument-names command
149    set -l condition '__fish_seen_subcommand_from msiexec'
150    complete -c $command -a '/? /h' -d 'Show help' -n $condition
151
152    complete -c $command -a '(__fish_msiexec_complete_option_arg)' \
153        -n $condition
154
155    complete -c $command -a /i \
156        -d 'Install the software' \
157        -n "$condition && __fish_msiexec__option_completion_condition"
158
159    set -l a_condition '__fish_seen_argument -w i -w p'
160
161    complete -c $command -a /a \
162        -d 'Use the administrator network' \
163        -n "$condition && $a_condition"
164
165    complete -c $command -a /f \
166        -d 'Repair the installation of software' \
167        -n "$condition && __fish_msiexec__option_completion_condition"
168
169    complete -c $command -a /uninstall \
170        -d 'Uninstall the software' \
171        -n "$condition && __fish_msiexec__option_completion_condition"
172
173    complete -c $command -a /j \
174        -d 'Advertise the software' \
175        -n "$condition && __fish_msiexec__option_completion_condition"
176
177    complete -c $command -a /p \
178        -d 'Apply the patch to software' \
179        -n "$condition && __fish_msiexec__option_completion_condition"
180
181    complete -c $command -a /q \
182        -d 'Change the UI while installing software' \
183        -n "$condition && __fish_msiexec__option_completion_condition"
184
185    complete -c $command -a /l \
186        -d 'Change the logging' \
187        -n "$condition && __fish_msiexec__option_completion_condition"
188
189    complete -c $command -a /y \
190        -d 'Register the MSI service' \
191        -n "$condition && __fish_msiexec__option_completion_condition"
192
193    complete -c $command -a /z \
194        -d 'Register the MSI service' \
195        -n "$condition && __fish_msiexec__option_completion_condition"
196end
197
198function __fish_wine__complete_regedit_subcommand --argument-names command
199    set -l condition '__fish_seen_subcommand_from regedit'
200    complete -c $command -a '/?' -d 'Show help' -n $condition
201
202    complete -c $command -a /L \
203        -d 'Specify the location of system.dat file' \
204        -n $condition
205
206    complete -c $command -a /R \
207        -d 'Specify the location of user.dat file' \
208        -n $condition
209
210    complete -c $command -a /C \
211        -d 'Import contents of a registry file' \
212        -n $condition
213
214    complete -c $command -a /D \
215        -d 'Delete a registry key' \
216        -n $condition
217
218    complete -c $command -a /E \
219        -d 'Export contents to a registry file' \
220        -n $condition
221
222    complete -c $command -a /S \
223        -d 'Do not display messages' \
224        -n $condition
225
226    complete -c $command -a /V \
227        -d 'Launch the GUI in an advanced mode' \
228        -n $condition
229
230    complete -c $command -a '(__fish_reg__complete_keys)' \
231        -n $condition
232end
233
234function __fish_wine__complete_start_subcommand --argument-names command
235    set -l condition '__fish_seen_subcommand_from start'
236    complete -c $command -a '/?' -d 'Show help' -n $condition
237
238    complete -c $command -a /d \
239        -d 'Specify the directory for a program' \
240        -n $condition
241
242    complete -c $command -a /b \
243        -d "Don't create the new console for a progra" \
244        -n $condition
245
246    complete -c $command -a /i \
247        -d 'Clear the environment for a program' \
248        -n $condition
249
250    complete -c $command -a /min \
251        -d 'Start a program in the minimized window' \
252        -n $condition
253
254    complete -c $command -a /max \
255        -d 'Start a program in the minimized window' \
256        -n $condition
257
258    complete -c $command -a /low \
259        -d 'Start a program in the idle priority class' \
260        -n $condition
261
262    complete -c $command -a /normal \
263        -d 'Start a program in the normal priority class' \
264        -n $condition
265
266    complete -c $command -a /high \
267        -d 'Start a program in the high priority class' \
268        -n $condition
269
270    complete -c $command -a /realtime \
271        -d 'Start a program in the realtime priority class' \
272        -n $condition
273
274    complete -c $command -a /abovenormal \
275        -d 'Start a program in the abovenormal priority class' \
276        -n $condition
277
278    complete -c $command -a /belownormal \
279        -d 'Start a program in the belownormal priority class' \
280        -n $condition
281
282    complete -c $command -a /node \
283        -d 'Specify the NUMA node for a program' \
284        -n $condition
285
286    complete -c $command -a /affinity \
287        -d 'Specify the affinity mask for a program' \
288        -n $condition
289
290    complete -c $command -a /wait \
291        -d 'Wait for a program to exit' \
292        -n $condition
293
294    complete -c $command -a /unix \
295        -d 'Use the Unix filename for a program' \
296        -n $condition
297end
298
299function __fish_wine__complete_winemenubuilder_subcommand --argument-names command
300    complete -c $command -a /w \
301        -d 'Wait till the shortcut can be created' \
302        -n '__fish_seen_subcommand_from winemenubuilder'
303end
304
305function __fish_wine__complete_winepath_subcommand --argument-names command
306    set -l condition '__fish_seen_subcommand_from winepath'
307    complete -c $command -s h -d 'Show help' -n $condition
308    complete -c $command -s v -d 'Show version' -n $condition
309
310    complete -c $command -s u -l unix \
311        -d 'Convert a Windows path to the Unix one' \
312        -n $condition
313
314    complete -c $command -s w -l windows \
315        -d 'Convert a Unix path to the Windows one' \
316        -n $condition
317
318    complete -c $command -s l -l long \
319        -d 'Convert a Windows path to the long format' \
320        -n $condition
321
322    complete -c $command -s s -l short \
323        -d 'Convert a Windows path to the short format' \
324        -n $condition
325end
326
327set -l command wine
328
329complete -c $command -l help -d 'Show help'
330complete -c $command -l version -d 'Show version'
331
332set -l subcommands_with_descriptions 'cacls\t"Edit ACLs"' \
333    'clock\t"Open the clock"' \
334    'cmd\t"Open the command prompt"' \
335    'cmdlgtst\t"commdlg.dll test jig"' \
336    'control\t"Open control panel"' \
337    'eject\t"Eject optical discs"' \
338    'expand\t"Expand cabinet files"' \
339    'explorer\t"Open Explorer"' \
340    'hh\t"Open HTML help"' \
341    'icinfo\t"List installed video compressors"' \
342    'iexplore\t"Open Internet Explorer"' \
343    'lodctr\t"Load performance monitor counters"' \
344    'msiexec\t"Open an installer for .msi files"' \
345    'net\t"Manage services"' \
346    'notepad\t"Notepad, a simple text editor"' \
347    'oleview\t"Browse and explore COM objects as well as configure DCOM"' \
348    'progman\t"Open Program manager"' \
349    'reg\t"Edit registry though command line"' \
350    'regedit\t"Edit registry"' \
351    'regsvr32\t"Register OLE components in the registry"' \
352    'rpcss\t"Open rpcss.exe"' \
353    'rundll32\t"Load a DLL and run an entry point"' \
354    'secedit\t"Edit security configuration"' \
355    'services\t"Manages services"' \
356    'spoolsv\t"Print documents"' \
357    'start\t"Start a program or open a file in the program"' \
358    'svchost\t"Host process for services"' \
359    'taskmgr\t"Open Task Manager"' \
360    'uninstaller\t"Uninstall a program"' \
361    'unlodctr\t"Unload performance monitor counters"' \
362    'view\t"View metafiles"' \
363    'wineboot\t"Reboot Wine"' \
364    'winebrowser\t"Launch native OS browser or mail client"' \
365    'winecfg\t"Configure wine through a GUI"' \
366    'wineconsole\t"Open Windows console"' \
367    'winedbg\t"Open debugger core"' \
368    'winedevice\t"Manages devices"' \
369    'winefile\t"Open file explorer"' \
370    'winemenubuilder\t"Build Unix menu entries"' \
371    'winemine\t"classic minesweeper game"' \
372    'winepath\t"Translate between Windows and Unix paths formats"' \
373    'winetest\t"Run DLL conformance test programs"' \
374    'winevdm\t"Open DOS"' \
375    'winhelp\t"Open help"' \
376    'winhlp32\t"HOpen help"' \
377    'winver\t"Show about information"' \
378    'wordpad\t"Open WordPad"' \
379    'write\t"Open WordPad"' \
380    'xcopy\t"Run xcopy"'
381
382set -l subcommands (string replace --regex '\\\t.+' '' -- $subcommands_with_descriptions)
383set -l root_condition "not __fish_seen_subcommand_from $subcommands"
384complete -c $command -a "$subcommands_with_descriptions" -n $root_condition
385
386__fish_wine__complete_cmd_subcommand $command
387__fish_wine__complete_control_subcommand $command
388__fish_wine__complete_eject_subcommand $command
389__fish_wine__complete_explorer_subcommand $command
390__fish_wine__complete_msiexec_subcommand $command
391__fish_wine__complete_regedit_subcommand $command
392__fish_wine__complete_start_subcommand $command
393__fish_wine__complete_winemenubuilder_subcommand $command
394__fish_wine__complete_winepath_subcommand $command