| 1 |
_ldattach_module() |
| 2 |
{ |
| 3 |
local cur prev OPTS |
| 4 |
COMPREPLY=() |
| 5 |
cur="${COMP_WORDS[COMP_CWORD]}" |
| 6 |
prev="${COMP_WORDS[COMP_CWORD-1]}" |
| 7 |
case $prev in |
| 8 |
'-s'|'--speed') |
| 9 |
COMPREPLY=( $(compgen -W "speed" -- $cur) ) |
| 10 |
return 0 |
| 11 |
;; |
| 12 |
'-c'|'--intro-command') |
| 13 |
COMPREPLY=( $(compgen -W "string" -- $cur) ) |
| 14 |
return 0 |
| 15 |
;; |
| 16 |
'-p'|'--pause') |
| 17 |
COMPREPLY=( $(compgen -W "seconds" -- $cur) ) |
| 18 |
return 0 |
| 19 |
;; |
| 20 |
'-i'|'--iflag') |
| 21 |
local IFLAGS |
| 22 |
IFLAGS="BRKINT ICRNL IGNBRK IGNCR IGNPAR IMAXBEL |
| 23 |
INLCR INPCK ISTRIP IUCLC IUTF8 IXANY |
| 24 |
IXOFF IXON PARMRK |
| 25 |
-BRKINT -ICRNL -IGNBRK -IGNCR -IGNPAR -IMAXBEL |
| 26 |
-INLCR -INPCK -ISTRIP -IUCLC -IUTF8 -IXANY |
| 27 |
-IXOFF -IXON -PARMRK" |
| 28 |
COMPREPLY=( $(compgen -W "$IFLAGS" -- $cur) ) |
| 29 |
return 0 |
| 30 |
;; |
| 31 |
'-m'|'--mtu') |
| 32 |
COMPREPLY=( $(compgen -W "mtu" -- $cur) ) |
| 33 |
return 0 |
| 34 |
;; |
| 35 |
'-h'|'--help'|'-V'|'--version') |
| 36 |
return 0 |
| 37 |
;; |
| 38 |
esac |
| 39 |
case $cur in |
| 40 |
-*) |
| 41 |
OPTS="--debug |
| 42 |
--speed |
| 43 |
--intro-command |
| 44 |
--pause |
| 45 |
--sevenbits |
| 46 |
--eightbits |
| 47 |
--noparity |
| 48 |
--evenparity |
| 49 |
--oddparity |
| 50 |
--onestopbit |
| 51 |
--twostopbits |
| 52 |
--iflag |
| 53 |
--mtu |
| 54 |
--help |
| 55 |
--version" |
| 56 |
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) |
| 57 |
return 0 |
| 58 |
;; |
| 59 |
/*) |
| 60 |
local IFS=$'\n' |
| 61 |
compopt -o filenames |
| 62 |
COMPREPLY=( $(compgen -f -- $cur) ) |
| 63 |
return 0 |
| 64 |
;; |
| 65 |
esac |
| 66 |
local LDISC_DEVICE |
| 67 |
LDISC_DEVICE="6PACK AX25 GIGASET GIGASET_M101 HCI HDLC IRDA M101 |
| 68 |
MOUSE PPP PPS R3964 SLIP STRIP SYNCPPP SYNC_PPP |
| 69 |
TTY X25 /dev/" |
| 70 |
COMPREPLY=( $(compgen -W "$LDISC_DEVICE" -- $cur) ) |
| 71 |
return 0 |
| 72 |
} |
| 73 |
complete -F _ldattach_module ldattach |