]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/write
su: use lib/pty-session.c code for --pty
[thirdparty/util-linux.git] / bash-completion / write
CommitLineData
8884f6d5
SK
1_write_module()
2{
d4f9b8d7 3 local cur prev
8884f6d5
SK
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
8884f6d5
SK
12 case $COMP_CWORD in
13 1)
e4fc3d57 14 COMPREPLY=( $(compgen -W '$(users)' -- $cur) )
8884f6d5
SK
15 return 0
16 ;;
17 2)
e4fc3d57 18 COMPREPLY=( $(compgen -W "$(w -h $prev | awk '{print $2}')" -- $cur) )
8884f6d5
SK
19 return 0
20 ;;
21 esac
22 return 0
23}
24complete -F _write_module write