fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
86e531b84
master
1function __fish_wine_explorer__complete_desktop_arg 2set -l current_token( commandline -tc) 3 4switch " $current_token " 5case '/desktop=*x*' 6return 7case '/desktop=*' 8printf '%sx' " $current_token " 9end 10end 11 12function __fish_msiexec__option_completion_condition 13set -l token( commandline -oc)[ 3 ] 14 15not string match --quiet --regex'^/(uninstall|[ipyz])$|^/[fjql]' --" $token " 16end 17 18function __fish_msiexec_complete_option_arg 19set -l current_token( commandline -tc) 20 21switch " $current_token " 22case '/f*' 23set 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 34case '/q*' 35set values'n\tDisable UI' \ 36'b\tShow the basic UI' \ 37'r\tShow the reduced UI' \ 38'f\tShow the full UI' 39 40case '/l*' 41set 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' 56end 57 58for valuein $values 59echo -e" $current_token$value " 60end 61end 62 63function __fish_wine__complete_cmd_subcommand --argument-names command 64set -l condition'__fish_seen_subcommand_from cmd' 65complete -c$command -a'(__fish_cmd__complete_args)' -n$condition 66 67set -l c_and_k_condition'not __fish_seen_argument -w c -w k' 68 69complete -c$command -a /c\ 70 -d'Run the command and stop' \ 71 -n" $condition && $c_and_k_condition " 72 73complete -c$command -a /k\ 74 -d'Run the command and continue' \ 75 -n" $condition && $c_and_k_condition " 76 77complete -c$command -a /s\ 78 -d'Modify the treatment of string after /c or /k' \ 79 -n$condition 80 81complete -c$command -a /q -d'Turn echo off' -n$condition 82 83complete -c$command -a /d\ 84 -d'Disable execution of AutoRun commands' \ 85 -n$condition 86 87set -l a_and_u_condition'not __fish_seen_argument -w a -w u' 88 89complete -c$command -a /a\ 90 -d'Format internal command output as ANSI' \ 91 -n" $condition && $a_and_u_condition " 92 93complete -c$command -a /u\ 94 -d'Format internal command output as Unicode' \ 95 -n" $condition && $a_and_u_condition " 96 97complete -c$command -a /t\ 98 -d'Set the background and foreground color' \ 99 -n$condition 100 101complete -c$command -a /e -d'Manage command extensions' -n$condition 102 103complete -c$command -a /f\ 104 -d'Manage file and directory name completion' \ 105 -n$condition 106 107complete -c$command -a /v\ 108 -d'Manage delayed environment variable expansion' \ 109 -n$condition 110 111complete -c$command -a'/?' -d'Show help' -n$condition 112end 113 114function __fish_wine__complete_control_subcommand --argument-names command 115set -l condition'__fish_seen_subcommand_from control' 116 117complete -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 123set -l condition'__fish_seen_subcommand_from eject' 124complete -c$command -s h -d'Show help' -n$condition 125complete -c$command -s a -d'Eject all the CD drives' -n$condition 126complete -c$command -s u -d'Unmount the CD drives' -n$condition 127end 128 129function __fish_wine__complete_explorer_subcommand --argument-names command 130set -l condition'__fish_seen_subcommand_from explorer' 131 132complete -c$command -a'(__fish_wine_explorer__complete_desktop_arg)' \ 133 -n$condition 134 135complete -c$command -a /n -d'Use the single pain view' -n$condition 136complete -c$command -a /e, -d'Use the default view' -n$condition 137 138complete -c$command -a /root, -d'Specify the root level of a view' \ 139 -n$condition 140 141complete -c$command -a /select, -d'Specify the selection in a view' \ 142 -n$condition 143 144complete -c$command -a /desktop= -d'Specify the desktop name' \ 145 -n$condition 146end 147 148function __fish_wine__complete_msiexec_subcommand --argument-names command 149set -l condition'__fish_seen_subcommand_from msiexec' 150complete -c$command -a'/? /h' -d'Show help' -n$condition 151 152complete -c$command -a'(__fish_msiexec_complete_option_arg)' \ 153 -n$condition 154 155complete -c$command -a /i\ 156 -d'Install the software' \ 157 -n" $condition && __fish_msiexec__option_completion_condition" 158 159set -l a_condition'__fish_seen_argument -w i -w p' 160 161complete -c$command -a /a\ 162 -d'Use the administrator network' \ 163 -n" $condition && $a_condition " 164 165complete -c$command -a /f\ 166 -d'Repair the installation of software' \ 167 -n" $condition && __fish_msiexec__option_completion_condition" 168 169complete -c$command -a /uninstall\ 170 -d'Uninstall the software' \ 171 -n" $condition && __fish_msiexec__option_completion_condition" 172 173complete -c$command -a /j\ 174 -d'Advertise the software' \ 175 -n" $condition && __fish_msiexec__option_completion_condition" 176 177complete -c$command -a /p\ 178 -d'Apply the patch to software' \ 179 -n" $condition && __fish_msiexec__option_completion_condition" 180 181complete -c$command -a /q\ 182 -d'Change the UI while installing software' \ 183 -n" $condition && __fish_msiexec__option_completion_condition" 184 185complete -c$command -a /l\ 186 -d'Change the logging' \ 187 -n" $condition && __fish_msiexec__option_completion_condition" 188 189complete -c$command -a /y\ 190 -d'Register the MSI service' \ 191 -n" $condition && __fish_msiexec__option_completion_condition" 192 193complete -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 199set -l condition'__fish_seen_subcommand_from regedit' 200complete -c$command -a'/?' -d'Show help' -n$condition 201 202complete -c$command -a /L\ 203 -d'Specify the location of system.dat file' \ 204 -n$condition 205 206complete -c$command -a /R\ 207 -d'Specify the location of user.dat file' \ 208 -n$condition 209 210complete -c$command -a /C\ 211 -d'Import contents of a registry file' \ 212 -n$condition 213 214complete -c$command -a /D\ 215 -d'Delete a registry key' \ 216 -n$condition 217 218complete -c$command -a /E\ 219 -d'Export contents to a registry file' \ 220 -n$condition 221 222complete -c$command -a /S\ 223 -d'Do not display messages' \ 224 -n$condition 225 226complete -c$command -a /V\ 227 -d'Launch the GUI in an advanced mode' \ 228 -n$condition 229 230complete -c$command -a'(__fish_reg__complete_keys)' \ 231 -n$condition 232end 233 234function __fish_wine__complete_start_subcommand --argument-names command 235set -l condition'__fish_seen_subcommand_from start' 236complete -c$command -a'/?' -d'Show help' -n$condition 237 238complete -c$command -a /d\ 239 -d'Specify the directory for a program' \ 240 -n$condition 241 242complete -c$command -a /b\ 243 -d"Don't create the new console for a progra" \ 244 -n$condition 245 246complete -c$command -a /i\ 247 -d'Clear the environment for a program' \ 248 -n$condition 249 250complete -c$command -a /min\ 251 -d'Start a program in the minimized window' \ 252 -n$condition 253 254complete -c$command -a /max\ 255 -d'Start a program in the minimized window' \ 256 -n$condition 257 258complete -c$command -a /low\ 259 -d'Start a program in the idle priority class' \ 260 -n$condition 261 262complete -c$command -a /normal\ 263 -d'Start a program in the normal priority class' \ 264 -n$condition 265 266complete -c$command -a /high\ 267 -d'Start a program in the high priority class' \ 268 -n$condition 269 270complete -c$command -a /realtime\ 271 -d'Start a program in the realtime priority class' \ 272 -n$condition 273 274complete -c$command -a /abovenormal\ 275 -d'Start a program in the abovenormal priority class' \ 276 -n$condition 277 278complete -c$command -a /belownormal\ 279 -d'Start a program in the belownormal priority class' \ 280 -n$condition 281 282complete -c$command -a /node\ 283 -d'Specify the NUMA node for a program' \ 284 -n$condition 285 286complete -c$command -a /affinity\ 287 -d'Specify the affinity mask for a program' \ 288 -n$condition 289 290complete -c$command -a /wait\ 291 -d'Wait for a program to exit' \ 292 -n$condition 293 294complete -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 300complete -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 306set -l condition'__fish_seen_subcommand_from winepath' 307complete -c$command -s h -d'Show help' -n$condition 308complete -c$command -s v -d'Show version' -n$condition 309 310complete -c$command -s u -l unix\ 311 -d'Convert a Windows path to the Unix one' \ 312 -n$condition 313 314complete -c$command -s w -l windows\ 315 -d'Convert a Unix path to the Windows one' \ 316 -n$condition 317 318complete -c$command -s l -l long\ 319 -d'Convert a Windows path to the long format' \ 320 -n$condition 321 322complete -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