commit d9738a5372f57076cc0bce79855f2974beee1c08
Author: Fabian Greffrath <fabian@greffrath.com>
AuthorDate: Sun Oct 18 11:48:57 2015 +0200
Commit: Fabian Greffrath <fabian@greffrath.com>
CommitDate: Sun Oct 18 11:48:57 2015 +0200
man: add a bash-completion scriptlet
Only one for all four games and only static for the time being.
In the long term, we should modify the docgen script to emit the
possible valid command line parameters and their additional options
and thus create separate bash-completion scriptlets for all four
games.
---
man/bash-completion/chocolate-doom | 58 ++++++++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/man/bash-completion/chocolate-doom b/man/bash-completion/chocolate-doom
new file mode 100644
index 00000000..280bc726
--- /dev/null
+++ b/man/bash-completion/chocolate-doom
@@ -0,0 +1,58 @@
+# bash completion for Chocolate Doom -*- shell-script -*-
+
+_chocolate_doom()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -config|-extraconfig)
+ _filedir cfg
+ ;;
+ -episode)
+ COMPREPLY=(1 2 3 4)
+ ;;
+ -file|-iwad|-aa|-af|-as|-merge|-nwtmerge)
+ _filedir wad
+ ;;
+ -loadgame)
+ COMPREPLY=(0 1 2 3 4 5)
+ ;;
+ -pack)
+ COMPREPLY=(doom2 tnt plutonia)
+ ;;
+ -skill)
+ COMPREPLY=(1 2 3 4 5)
+ ;;
+ -gameversion)
+ COMPREPLY=(1.9 ultimate final final2 hacx chex)
+ ;;
+ -setmen)
+ COMPREPLY=(dos622 dos71 dosbox)
+ ;;
+ -playdemo|-timedemo)
+ _filedir lmp
+ ;;
+ -deh)
+ _filedir bex deh
+ ;;
+ esac
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '-1 -2 -3 -aa -af -altdeath -as -autojoin -avg
+ -cdrom -config -connect -deathmatch -dedicated -deh -dehlump -devparm
+ -donut -dumpsubstconfig -dup -episode -extraconfig -extratics -fast
+ -file -fullscreen -gameversion -geometry -grabmouse -height
+ -ignoreversion -iwad -left -loadgame -localsearch -longtics -maxdemo -mb
+ -merge -mmap -newsync -noblit -nocheats -nodeh -nodes -nodraw
+ -nograbmouse -nomonsters -nomouse -nomusic -nonovert -nosfx -nosound
+ -novert -nwtmerge -pack -playdemo -port -privateserver -query -record
+ -respawn -right -search -server -servername -setmem -skill -solo
+ -spechit -statdump -timedemo -timer -turbo -warp -width -window
+ -zonescan -zonezero ' -- "$cur" ) )
+ fi
+} &&
+
+complete -F _chocolate_doom chocolate-doom chocolate-heretic chocolate-hexen chocolate-strife
+
+# ex: ts=4 sw=4 et filetype=sh