summaryrefslogtreecommitdiffstats
path: root/shell-completion/write
diff options
context:
space:
mode:
Diffstat (limited to 'shell-completion/write')
-rw-r--r--shell-completion/write22
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