Skip to content

Instantly share code, notes, and snippets.

@mmaulwurff
Last active Feb 9, 2019
Embed
What would you like to do?
zsh completion for GZDoom
#compdef _gzdoom
# Completions for GZDoom
# Tested on GZDoom 3.7.2, zsh 5.3.1
#
# Version: 0.1
#
# Known problems/limitations
# P1. Completion doesn't reflect that a single -file option can take multiple files.
#
# Sources
# S1. http://zsh.sourceforge.net/Doc/Release/Completion-System.html
# S2. https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org
# S3. https://zdoom.org/wiki/Command_line_parameters
_arguments \
'*-file[loads one or more PWAD files]:filename:_files -g "*.(wad|WAD|pk3|PK3|pk7|PK7|zip|ZIP)"' \
'-iwad[loads IWAD file]:filename:_files -g "*.(wad|WAD|pk3|PK3|pk7|PK7|zip|ZIP)"' \
'-config[causes GZDoom to use an alternative configuration file]:configfile:_files' \
'-nosound[disables both music and sound effects]' \
'-savedir[specifies an alternate directory to use for saved files]:directory:_files -/' \
'-nomonsters[monsters are not spawned on levels]' \
'-fast[monsters are as fast as in Nightmare mode]' \
'-respawn[monsters respawn even if you are not playing at Nightmare difficulty]' \
'-deh[applies a DeHackEd or .bex patch to the game]:filename:_files -g "*.(deh|DEH|bex|BEX)"' \
'-noautoload[prevents files from being autoloaded]' \
'-loadgame[automatically loads the specified savegame]:filename:_files -g "*.(zds|ZDS)"' \
'-playdemo[automatically plays the specified demo]:filename:_files -g "*.(lmp|LMP)"' \
'-record[records a demo]:filename:_files -g "*.(lmp|LMP)"' \
'+map[starts the game on the specified map]:mapname:' \
'-norun[quits the game just before video initialization]' \
'-host[starts multiplayer game as a host]:playernumber:(1 2 3 4 5 6 7 8)' \
'-skill[sets the initial skill level]:skilllevel:(( \
1\:"I'\''m Too Young to Die" \
2\:"Hey, Not Too Rough" \
3\:"Hurt Me Plenty" \
4\:"Ultra-Violence" \
5\:"Nightmare!" \
))' \
'-join[connects to a host for a multiplayer game]:address:' \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment