]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/uuidparse
rev: be careful with close()
[thirdparty/util-linux.git] / bash-completion / uuidparse
CommitLineData
5d70066c
SK
1_uuidparse_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 '-o'|'--output')
9 local prefix realcur OUTPUT
10 realcur="${cur##*,}"
11 prefix="${cur%$realcur}"
12 for WORD in "UUID VARIANT TYPE TIME"; do
13 if ! [[ $prefix == *"$WORD"* ]]; then
14 OUTPUT="$WORD ${OUTPUT:-""}"
15 fi
16 done
17 compopt -o nospace
18 COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) )
19 return 0
20 ;;
21 '-h'|'--help'|'-V'|'--version')
22 return 0
23 ;;
24 esac
25 OPTS="
26 --json
27 --noheadings
28 --output
29 --raw
30 --help
31 --version
32 "
33 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
34 return 0
35
36}
37complete -F _uuidparse_module uuidparse