File: hexen.template.in

package info (click to toggle)
crispy-doom 7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,972 kB
  • sloc: ansic: 254,242; makefile: 986; objc: 951; python: 722; sh: 90; xml: 7
file content (45 lines) | stat: -rw-r--r-- 1,126 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# bash completion for @PACKAGE_SHORTNAME@ Hexen              -*- shell-script -*-

_@PROGRAM_SPREFIX@_hexen()
{
    local cur prev words cword
    _init_completion || return

    # Save the previous switch on the command line in the prevsw variable
    local i prevsw=""
    for (( i=1; $cword > 1 && i <= $cword; i++ )); do
        if [[ ${words[i]} == -* ]]; then
            prevsw=${words[i]}
        fi
    done

    # Allow adding more than one file with the same extension to the same switch
    case $prevsw in
        -config|-extraconfig)
            _filedir cfg
            ;;
        -file|-iwad|-aa|-af|-as|-merge|-nwtmerge)
            _filedir wad
            ;;
        -playdemo|-timedemo)
            _filedir lmp
            ;;
    esac

    case $prev in
        -gameversion)
            COMPREPLY=(1.1 1.1r2)
            ;;
        -setmem)
            COMPREPLY=(dos622 dos71 dosbox)
            ;;
    esac

    if [[ $cur == -* ]]; then
        COMPREPLY=( $( compgen -W '@content' -- "$cur" ) )
    fi
} &&

complete -F _@PROGRAM_SPREFIX@_hexen @PROGRAM_PREFIX@hexen

# ex: ts=4 sw=4 et filetype=sh