]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/lscpu
su: change error message
[thirdparty/util-linux.git] / bash-completion / lscpu
1 _lscpu_module()
2 {
3 local cur OPTS_ALL
4 COMPREPLY=()
5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
7 case $prev in
8 '--extended='|'=')
9 local prefix realcur OPTS
10 cur=${cur#=}
11 realcur="${cur##*,}"
12 prefix="${cur%$realcur}"
13 OPTS_ALL="CPU CORE SOCKET NODE
14 BOOK DRAWER CACHE POLARIZATION ADDRESS
15 CONFIGURED ONLINE MAXMHZ MINMHZ"
16 for WORD in $OPTS_ALL; do
17 if ! [[ $prefix == *"$WORD"* ]]; then
18 OPTS="$WORD ${OPTS:-""}"
19 fi
20 done
21 compopt -o nospace
22 COMPREPLY=( $(compgen -P "$prefix" -W "$OPTS" -S ',' -- $realcur) )
23 return 0
24 ;;
25 '-h'|'--help'|'-V'|'--version')
26 return 0
27 ;;
28 esac
29 case $cur in
30 -*)
31 OPTS_ALL="--all
32 --online
33 --offline
34 --json
35 --extended=
36 --parse=
37 --sysroot
38 --hex
39 --physical
40 --output-all
41 --help
42 --version"
43 COMPREPLY=( $(compgen -W "${OPTS_ALL[*]}" -- $cur) )
44 return 0
45 ;;
46 esac
47 local IFS=$'\n'
48 compopt -o filenames
49 COMPREPLY=( $(compgen -f -- $cur) )
50 return 0
51 }
52 complete -F _lscpu_module lscpu