by Caligari87 » Fri Jun 09, 2017 3:09 pm
Not sure where the right place to put this is, as it's Linux-specific and I'm not sure how installation paths are determined in the GitHub source. Hope that's not a problem.
In short, this file will provide command-line auto-completion for gzdoom when running in a (ba)sh terminal. I built it from a template at
this page. Per that page, on Debian-based platforms at least, this file (named simply "gzdoom") may be placed or softlinked into "/etc/bash_completion.d/". I've done that on my Linux Mint system and it works like a charm.
UPDATED: autocompletes directories/files now
Spoiler:
Code: Select all
_gzdoom()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-2 -4 -bits -width -height -blockmap -cdrom -config -iwad -nocdaudio -nomusic -nosfx -nosound -nostartup -oldsprites -savedir -avg -fast -nomonsters -respawn -timer -turbo -deh -bex -file -noautoload -loadgame -playdemo -record +playerclass -skill -timedemo -warp -warpwipe -xlat -0 -debugfile -devparm -hashfiles -noblit -nodraw -norun -stdout -altdeath -deathmatch -dup -extratic -host -join -net -netmode -port +set"
if [[ ${cur} == -* ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
else
_filedir
fi
}
complete -o filenames -F _gzdoom gzdoom
I used the wiki page on [wiki]Command line parameters[/wiki] to get the options I included, minus the Zandronum-specific section. There's probably additional possibilities which could be added, both static and context-sensitive.
Not sure where the right place to put this is, as it's Linux-specific and I'm not sure how installation paths are determined in the GitHub source. Hope that's not a problem.
In short, this file will provide command-line auto-completion for gzdoom when running in a (ba)sh terminal. I built it from a template at [url=https://debian-administration.org/article/317/An_introduction_to_bash_completion_part_2]this page[/url]. Per that page, on Debian-based platforms at least, this file (named simply "gzdoom") may be placed or softlinked into "/etc/bash_completion.d/". I've done that on my Linux Mint system and it works like a charm.
UPDATED: autocompletes directories/files now
[spoiler][code]_gzdoom()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-2 -4 -bits -width -height -blockmap -cdrom -config -iwad -nocdaudio -nomusic -nosfx -nosound -nostartup -oldsprites -savedir -avg -fast -nomonsters -respawn -timer -turbo -deh -bex -file -noautoload -loadgame -playdemo -record +playerclass -skill -timedemo -warp -warpwipe -xlat -0 -debugfile -devparm -hashfiles -noblit -nodraw -norun -stdout -altdeath -deathmatch -dup -extratic -host -join -net -netmode -port +set"
if [[ ${cur} == -* ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
else
_filedir
fi
}
complete -o filenames -F _gzdoom gzdoom[/code][/spoiler]
I used the wiki page on [wiki]Command line parameters[/wiki] to get the options I included, minus the Zandronum-specific section. There's probably additional possibilities which could be added, both static and context-sensitive.
8-)