summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-10-21 20:57:01 +0200
committerOliver Kiddle <opk@zsh.org>2014-10-21 20:57:01 +0200
commit2ecc4bab417e1d67516e7fc5b94904daa3e32c3f (patch)
treed642ff29c08085f5dac27ca2972e7f7abb0f28ba
parent5e592fd9b0d0d5a0532ffa57667b3f5e7c09fa92 (diff)
downloadzsh-2ecc4bab417e1d67516e7fc5b94904daa3e32c3f.tar.gz
zsh-2ecc4bab417e1d67516e7fc5b94904daa3e32c3f.zip
33486: new completion function
-rw-r--r--ChangeLog2
-rw-r--r--Completion/X/Command/_rdesktop71
2 files changed, 73 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index b1b2dc7aa..3f13a2155 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2014-10-21 Oliver Kiddle <opk@zsh.org>
+ * 33486: Completion/X/Command/_rdesktop: new completion function
+
* 33485: Completion/BSD/Command/_portsnap,
Completion/Darwin/Command/_defaults,
Completion/Darwin/Command/_fink, Completion/Debian/Command/_dchroot,
diff --git a/Completion/X/Command/_rdesktop b/Completion/X/Command/_rdesktop
new file mode 100644
index 000000000..0bd08d932
--- /dev/null
+++ b/Completion/X/Command/_rdesktop
@@ -0,0 +1,71 @@
+#compdef rdesktop
+
+local curcontext="$curcontext" state line expl redir ret=1
+typeset -A opt_args
+
+_arguments -C -s \
+ '-u[username]:username:_users' \
+ '-d[domain]:domain' \
+ '-s[shell]:startup shell' \
+ '-c[working directory]:directory:_directories' \
+ '-p[password]:password' \
+ '-n[hostname]:host:_hosts' \
+ '-k[keyboard map]:keyboard map' \
+ '(-f)-g[geometry]:geometry (WxH)' \
+ '(-g)-f[fullscreen mode]' \
+ '-b[force server to use bitmaps for screen updates]' \
+ '-B[use X server backing store]' \
+ '-E[disable encryption]' \
+ "-m[don't send mouse motion events]" \
+ '-C[use private colormap]' \
+ '-D[hide window decorations]' \
+ '-K[do not override window manager key bindings]' \
+ '-S[single application mode]' \
+ '-T[set window title]:title' \
+ '-N[enable numlock synchronisation]' \
+ '-X[embed in another window]:window:_x_window' \
+ '-a[colour depth]:depth:(8 15 16 24)' \
+ '-z[enable compression]' \
+ '-x[bandwidth performance behaviour]:experience:((b\:broadband l\:lan m\:modem))' \
+ '-P[enable bitmap caching]' \
+ '*-r[device redirection]: :->redirection' \
+ '-0[attach to server console]' \
+ '(-5)-4[use RDP version 4]' \
+ '(-4)-5[use RDP version 5]' \
+ ':server:->hostsport' && ret=0
+
+case $state in
+ hostsport)
+ if compset -P '*:'; then
+ _ports && ret=0
+ else
+ compset -S ':*'
+ _hosts && ret=0
+ fi
+ ;;
+ redirection)
+ redir="${PREFIX%%:*}"
+ if compset -P '*='; then
+ curcontext="${curcontext%:*}:$redir"
+ compset -P '*='
+ case $redir in
+ comport|lptport) _wanted devices expl device _files -g '*(-%)' && ret=0 ;;
+ disk) _directories && ret=0 ;;
+ printer) _printers && ret=0 ;;
+ scard) _message -e aliases 'alias name' ;;
+ esac
+ else
+ compset -S '=*'
+ _values -S : 'redirection' \
+ 'comport:port' \
+ 'disk:sharename' \
+ 'lptport:lptport' \
+ 'printer:printername:_printers -S=' \
+ 'sound:sound:(local off remote)' \
+ 'lspci' \
+ 'scard:sound card name' && ret=0
+ fi
+ ;;
+esac
+
+return ret