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.
25 # Complete the arguments to the options.
28 local baudrates="@BAUDRATES@"
29 COMPREPLY=( $(compgen -W "$baudrates" -- ${cur}) )
33 COMPREPLY=( $(compgen -W "5 6 7 8" -- ${cur}) )
37 COMPREPLY=( $(compgen -W "hard soft none" -- ${cur}) )
41 COMPREPLY=( $(compgen -W "1 2" -- ${cur}) )
45 COMPREPLY=( $(compgen -W "even odd none" -- ${cur}) )
49 COMPREPLY=( $(compgen -W "0 1 10 100" -- ${cur}) )
52 -n | --no-autoconnect)
53 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
57 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
61 COMPREPLY=( $(compgen -W "ICRNL IGNCR INLCR INLCRNL OCRNL ODELBS ONLCRNL" -- ${cur}) )
65 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
69 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
76 COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
80 # Bind completion to tio command
81 complete -o default -F _tio tio