2 # Bash completion script for tio.
7 local cur prev opts base
9 cur="${COMP_WORDS[COMP_CWORD]}"
10 prev="${COMP_WORDS[COMP_CWORD-1]}"
12 # The options we'll complete.
24 # Complete the arguments to the options.
27 local baudrates="@BAUDRATES@"
28 COMPREPLY=( $(compgen -W "$baudrates" -- ${cur}) )
32 COMPREPLY=( $(compgen -W "5 6 7 8" -- ${cur}) )
36 COMPREPLY=( $(compgen -W "hard soft none" -- ${cur}) )
40 COMPREPLY=( $(compgen -W "1 2" -- ${cur}) )
44 COMPREPLY=( $(compgen -W "even odd none" -- ${cur}) )
48 COMPREPLY=( $(compgen -W "0 1 10 100" -- ${cur}) )
51 -n | --no-autoconnect)
52 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
56 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
60 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
64 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
71 COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
75 # Bind completion to tio command
76 complete -o default -F _tio tio