diff options
author | Sami Kerola | 2013-03-25 22:37:36 +0100 |
---|---|---|
committer | Sami Kerola | 2013-04-01 18:41:55 +0200 |
commit | 8884f6d5f41aec30ae45c35590eedfd0d6a41858 (patch) | |
tree | 44d068dfa9089494da47133831bb56b2acca46d5 /shell-completion/write | |
parent | bash-completion: sys-utils (diff) | |
download | kernel-qcow2-util-linux-8884f6d5f41aec30ae45c35590eedfd0d6a41858.tar.gz kernel-qcow2-util-linux-8884f6d5f41aec30ae45c35590eedfd0d6a41858.tar.xz kernel-qcow2-util-linux-8884f6d5f41aec30ae45c35590eedfd0d6a41858.zip |
bash-completion: term-utils
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'shell-completion/write')
-rw-r--r-- | shell-completion/write | 22 |
1 files changed, 22 insertions, 0 deletions
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 |