]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/lsipc
Merge branch 'PR/libsmartcols-reduce-fix' of github.com:karelzak/util-linux-work
[thirdparty/util-linux.git] / bash-completion / lsipc
CommitLineData
9d20ffda
KZ
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 '-h'|'--help'|'-V'|'--version')
13 return 0
14 ;;
d092911b
SK
15 '--time-format')
16 COMPREPLY=( $(compgen -W "short full iso" -- $cur) )
17 return 0
18 ;;
9d20ffda
KZ
19 '-o'|'--output')
20 local prefix realcur OUTPUT_ALL OUTPUT
21 realcur="${cur##*,}"
22 prefix="${cur%$realcur}"
d092911b
SK
23 OUTPUT_ALL="
24 KEY ID OWNER PERMS CUID CUSER CGID
25 CGROUP UID USER GID GROUP CTIME
26
27 SIZE NATTCH STATUS ATTACH DETACH
28 COMMAND CPID LPID
29
30 USEDBYTES MSGS SEND RECV LSPID LRPID
31
32 NSEMS OTIME
33
34 RESOURCE DESCRIPTION LIMIT USED USE%
35 "
9d20ffda
KZ
36 for WORD in $OUTPUT_ALL; do
37 if ! [[ $prefix == *"$WORD"* ]]; then
abbcec4f 38 OUTPUT="$WORD ${OUTPUT:-""}"
9d20ffda
KZ
39 fi
40 done
41 compopt -o nospace
42 COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) )
43 return 0
44 ;;
45 esac
d092911b
SK
46 OPTS="
47 --shmems
48 --queues
49 --semaphores
50 --global
51 --id
52 --noheadings
53 --notruncate
54 --time-format
55 --bytes
56 --creator
57 --export
58 --json
59 --newline
60 --list
61 --output
62 --numeric-perms
63 --raw
64 --time
65 --help
66 --version
67 "
68 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
9d20ffda
KZ
69 return 0
70}
71complete -F _lsipc_module lsipc