]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/resizepart
su: use lib/pty-session.c code for --pty
[thirdparty/util-linux.git] / bash-completion / resizepart
CommitLineData
bf60993c
SK
1_resizepart_module()
2{
3 local cur prev OPTS
4 COMPREPLY=()
5 cur="${COMP_WORDS[COMP_CWORD]}"
d4f9b8d7
VS
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
7 case $prev in
8 '-h'|'--help'|'-V'|'--version')
9 return 0
10 ;;
11 esac
bf60993c
SK
12 case $COMP_CWORD in
13 1)
53154dae 14 OPTS="--help --version $(lsblk -pnro name)"
0c8865f8 15 compopt -o bashdefault -o default
bf60993c
SK
16 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
17 ;;
18 2)
19 prev="${COMP_WORDS[COMP_CWORD-1]}"
20 COMPREPLY=( $(compgen -W "$(cat /sys/block/${prev##*/}/*/partition 2>/dev/null)" -- $cur) )
21 ;;
22 3)
23 COMPREPLY="length"
24 ;;
25 esac
26 return 0
27}
28complete -F _resizepart_module resizepart