Debian Codegraph @

bash-completion/lsipc

raw
1 _lsipc_module()
2 {
3 local cur prev OPTS ARG
4 COMPREPLY=()
5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
7 case $prev in
8 '-i'|'--id')
9 COMPREPLY=( $(compgen -W "id" -- $cur) )
10 return 0
11 ;;
12 '-N'|'--name')
13 COMPREPLY=( $(compgen -W "name" -- $cur) )
14 return 0
15 ;;
16 '-h'|'--help'|'-V'|'--version')
17 return 0
18 ;;
19 '--time-format')
20 COMPREPLY=( $(compgen -W "short full iso" -- $cur) )
21 return 0
22 ;;
23 '-o'|'--output')
24 local prefix realcur OUTPUT_ALL OUTPUT
25 realcur="${cur##*,}"
26 prefix="${cur%$realcur}"
27 OUTPUT_ALL="
28 KEY ID OWNER PERMS CUID CUSER CGID
29 CGROUP UID USER GID GROUP CTIME
30
31 SIZE NATTCH STATUS ATTACH DETACH
32 COMMAND CPID LPID
33
34 USEDBYTES MSGS SEND RECV LSPID LRPID
35
36 NSEMS OTIME
37
38 RESOURCE DESCRIPTION LIMIT USED USE%
39 "
40 for WORD in $OUTPUT_ALL; do
41 if ! [[ $prefix == *"$WORD"* ]]; then
42 OUTPUT="$WORD ${OUTPUT:-""}"
43 fi
44 done
45 compopt -o nospace
46 COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) )
47 return 0
48 ;;
49 esac
50 OPTS="
51 --shmems
52 --posix-shmems
53 --queues
54 --posix-mqueues
55 --semaphores
56 --posix-semaphores
57 --global
58 --id
59 --name
60 --noheadings
61 --notruncate
62 --time-format
63 --bytes
64 --creator
65 --export
66 --json
67 --newline
68 --list
69 --output
70 --numeric-perms
71 --raw
72 --time
73 --shell
74 --help
75 --version
76 "
77 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
78 return 0
79 }
80 complete -F _lsipc_module lsipc