]> git.sur5r.net Git - tio/blob - src/bash-completion/tio.in
New upstream version 1.30
[tio] / src / bash-completion / tio.in
1 #
2 # Bash completion script for tio.
3 #
4
5 _tio()
6 {
7     local cur prev opts base
8     COMPREPLY=()
9     cur="${COMP_WORDS[COMP_CWORD]}"
10     prev="${COMP_WORDS[COMP_CWORD-1]}"
11
12     #  The options we'll complete.
13     opts="-b --baudrate \
14           -d --databits \
15           -f --flow \
16           -s --stopbits \
17           -p --parity \
18           -o --output-delay \
19           -n --no-autoconnect \
20           -l --log \
21           -m --map \
22           -v --version \
23           -h --help"
24
25     #  Complete the arguments to the options.
26     case "${prev}" in
27         -b | --baudrate)
28             local baudrates="@BAUDRATES@"
29             COMPREPLY=( $(compgen -W "$baudrates" -- ${cur}) )
30             return 0
31             ;;
32         -d | --databits)
33             COMPREPLY=( $(compgen -W "5 6 7 8" -- ${cur}) )
34             return 0
35             ;;
36         -f | --flow)
37             COMPREPLY=( $(compgen -W "hard soft none" -- ${cur}) )
38             return 0
39             ;;
40         -s | --stopbits)
41             COMPREPLY=( $(compgen -W "1 2" -- ${cur}) )
42             return 0
43             ;;
44         -p | --parity)
45             COMPREPLY=( $(compgen -W "even odd none" -- ${cur}) )
46             return 0
47             ;;
48         -o | --output-delay)
49             COMPREPLY=( $(compgen -W "0 1 10 100" -- ${cur}) )
50             return 0
51             ;;
52         -n | --no-autoconnect)
53             COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
54             return 0
55             ;;
56         -l | --log)
57             COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
58             return 0
59             ;;
60         -m | --map)
61             COMPREPLY=( $(compgen -W "ICRNL IGNCR INLCR INLCRNL OCRNL ODELBS ONLCRNL" -- ${cur}) )
62             return 0
63             ;;
64         -v | --version)
65             COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
66             return 0
67             ;;
68         -h | --help)
69             COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
70             return 0
71             ;;
72         *)
73         ;;
74     esac
75
76    COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
77    return 0
78 }
79
80 # Bind completion to tio command
81 complete -o default -F _tio tio