From 8884f6d5f41aec30ae45c35590eedfd0d6a41858 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Mon, 25 Mar 2013 21:37:36 +0000 Subject: bash-completion: term-utils Signed-off-by: Sami Kerola --- shell-completion/write | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 shell-completion/write (limited to 'shell-completion/write') diff --git a/shell-completion/write b/shell-completion/write new file mode 100644 index 000000000..d41159b2d --- /dev/null +++ b/shell-completion/write @@ -0,0 +1,22 @@ +_write_module() +{ + local cur + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + case $COMP_CWORD in + 1) + COMPREPLY=( $(compgen -u -- $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) ) + return 0 + ;; + esac + return 0 +} +complete -F _write_module write -- cgit v1.2.3-55-g7522