| 1 |
_ipcmk_module() |
| 2 |
{ |
| 3 |
local cur prev |
| 4 |
COMPREPLY=() |
| 5 |
cur="${COMP_WORDS[COMP_CWORD]}" |
| 6 |
prev="${COMP_WORDS[COMP_CWORD-1]}" |
| 7 |
case $prev in |
| 8 |
'-M'|'--shmem') |
| 9 |
COMPREPLY=( $(compgen -W "size" -- $cur) ) |
| 10 |
return 0 |
| 11 |
;; |
| 12 |
'-m'|'--posix-shmem') |
| 13 |
COMPREPLY=( $(compgen -W "size" -- $cur) ) |
| 14 |
return 0 |
| 15 |
;; |
| 16 |
'-S'|'--semaphore') |
| 17 |
COMPREPLY=( $(compgen -W "number" -- $cur) ) |
| 18 |
return 0 |
| 19 |
;; |
| 20 |
'-s'|'--posix-semaphore'|'-Q'|'--queue'|'-q'|'--posix-mqueue') |
| 21 |
return 0 |
| 22 |
;; |
| 23 |
'-p'|'--mode') |
| 24 |
COMPREPLY=( $(compgen -W "mode" -- $cur) ) |
| 25 |
return 0 |
| 26 |
;; |
| 27 |
'-n'|'--name') |
| 28 |
COMPREPLY=( $(compgen -W "name" -- $cur) ) |
| 29 |
return 0 |
| 30 |
;; |
| 31 |
'-h'|'--help'|'-V'|'--version') |
| 32 |
return 0 |
| 33 |
;; |
| 34 |
esac |
| 35 |
COMPREPLY=( $(compgen -W "--shmem --posix-shmem --semaphore --posix-semaphore --queue --posix-mqueue --mode --name --help --version" -- $cur) ) |
| 36 |
return 0 |
| 37 |
} |
| 38 |
complete -F _ipcmk_module ipcmk |