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=" 0 50 75 110 134 150 200 300 600 1200 1800 2400 4800 9600 19200 38400 57600 115200 230400 460800 500000 576000 921600 1000000 1152000 1500000 2000000 2500000 3000000 3500000 4000000"
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