summaryrefslogtreecommitdiffstats
path: root/bash-completion/write
diff options
context:
space:
mode:
authorSami Kerola2017-04-12 11:48:31 +0200
committerSami Kerola2017-04-17 19:34:14 +0200
commite4fc3d574c836d5a8b2ddbb4660b96609f028252 (patch)
treeb446c835f2c22aaa9a6e88cd5bb1680bec0c4fbc /bash-completion/write
parentbash-completion: update sys-utils (diff)
downloadkernel-qcow2-util-linux-e4fc3d574c836d5a8b2ddbb4660b96609f028252.tar.gz
kernel-qcow2-util-linux-e4fc3d574c836d5a8b2ddbb4660b96609f028252.tar.xz
kernel-qcow2-util-linux-e4fc3d574c836d5a8b2ddbb4660b96609f028252.zip
bash-completion: update term-utils
scriptreplay: Add --maxdelay option. Commit: 7f1d48363823f7da47ca56f84eb4b2155c5ed36b setterm: Add --resize coption. Commit: 5d795999511adc455d223be8281948796bd7d087 write: List only users who are online and determine tty based on given user name. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'bash-completion/write')
-rw-r--r--bash-completion/write8
1 files changed, 2 insertions, 6 deletions
diff --git a/bash-completion/write b/bash-completion/write
index 1fe080721..7b2d2fae3 100644
--- a/bash-completion/write
+++ b/bash-completion/write
@@ -11,15 +11,11 @@ _write_module()
esac
case $COMP_CWORD in
1)
- COMPREPLY=( $(compgen -u -- $cur) )
+ COMPREPLY=( $(compgen -W '$(users)' -- $cur) )
return 0
;;
2)
- local I TERMS=''
- for I in /sys/class/tty/*; do
- TERMS+="/dev${I##/sys/class/tty} "
- done
- COMPREPLY=( $(compgen -W "$TERMS" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(w -h $prev | awk '{print $2}')" -- $cur) )
return 0
;;
esac