Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1466511614; bh=bspRMCChSnUjgV8OPX38Gc1Z+tRqCtBbmR+tvN0vizI=; h=From:To:Subject:Date:From:Subject; b=FGMMNhLrozUhxgL8YVKbz9fscUX8CuaM8nleBoVrD/W95S91XZ0kUo2ovJrURuQBODUQlHvgy+rrDq/M8qfOnoMXCw6GYjBaPaFY4g4JY6XCJvhq2hQhGSxXYF9guuGn5rasipqCTTMxgrHV6tOGVR8IToZFrAHeG22FM0FhwWzlYgkqHJ+LNFeECoPpci7O8llSk1Uhnrde1MgGwqheANELGWSm+Nt2j78GXgswdez1gM2JJZprQ99Dfp8KgCp93GUARjiEahqXbYunMXHYMZnIXQhK3BBEUhxQ3691iFgPQQZUWO8XfMIKhMwGR2p8Tq2oFB46y2C+YsG2qoNlDQ==
X-Yahoo-Newman-Id: 417331.24076.bm@smtp104.mail.ir2.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: x5J3lbkVM1mDc76jLK0bTqOWNSkvCIR.G6mOaHyOkK4fxGf
 Ve_FHHWqpzstnFyTy5hOZg55mWr3c70VsxFL912YsCM_awnxPcVk.wU0Pt10
 838R63.nNrtHTDy_aZ782GqwzEUtZaH3x0FMxfhQ2EAb2MpzQ3JIkUjBiSEf
 Kzht7T422_k21MAWaUNDIlkeAyloa7HACqc37CowaHe55weWBlx.WpEmXULe
 o31eBvOb28akCtUxgRH9iTGCnanML2zW5m78Q.FYrRqaSrlP2apjJUbeTJNT
 uVvFwd4S2piE3XobTd8KPP_KYFT1nWwOqs6.X_B__JVnWCU3fMsfUUCPd3q.
 8BAJ2Fx6iSlkttwrdctkGCzq4oBZI7JVMZ0TqkFf8HMsUjjqncxHcggnMJ5E
 SLLGXEVZvQtPYe1EIyk.3UdmPZTI9OFzDSDycJEcR2ErJISVtTPULJUNxJR6
 1zIRT.GOCieFgzr_ZmyMmTvu9aHANhKv_M2N0AQSjn8DN_IAydvJ1m52HKA.
 repb7_NC__2dc1w0apn1SK9PS4XJCjQ--
X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI-
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: completion for xfreerdp
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <19511.1466511613.1@thecus.kiddle.eu>
Date: Tue, 21 Jun 2016 14:20:13 +0200
Message-ID: <19512.1466511613@thecus.kiddle.eu>
X-Seq: zsh-workers 38733

xfreerdp seems to have replaced rdesktop between RHEL 6 and 7. It is
similar enough that it seems to make sense to cover both in one
completion function.

Oliver

diff --git a/Completion/X/Command/_rdesktop b/Completion/X/Command/_rdesktop
index 0bd08d9..5e480b3 100644
--- a/Completion/X/Command/_rdesktop
+++ b/Completion/X/Command/_rdesktop
@@ -1,37 +1,81 @@
-#compdef rdesktop
+#compdef rdesktop xfreerdp
 
-local curcontext="$curcontext" state line expl redir ret=1
+local curcontext="$curcontext" state line expl args redir ret=1
 typeset -A opt_args
 
-_arguments -C -s \
+case $service in
+  rdesktop)
+    args=(
+      '(-5)-4[use RDP version 4]'
+      '(-4)-5[use RDP version 5]'
+      '-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]'
+      '-S[single application mode]'
+      '-N[enable numlock synchronisation]'
+      '-P[enable bitmap caching]'
+      '*-r[device redirection]: :->redirection'
+    )
+  ;;
+  xfreerdp)
+    args=(
+      '(-)'{-h,--help}'[display help information]'
+      "-o[don't redirect audio to client]"
+      '-s[set startup-shell]:shell'
+      '-t[connect to specified port]:port:_ports'
+      '--app[RemoteApp connection]'
+      '--ext[load an extension]:extension'
+      '--no-auth[disable authentication]'
+      '--authonly[authentication only, no UI]'
+      '--from-stdin[prompt for username, password, domain and hostname]'
+      '--no-fastpath[disable fast-path]'
+      '--gdi[graphics rendering]:backend:(hw sw)'
+      "--no-motion[don't send mouse motion events]"
+      '--no-osb[disable offscreen bitmaps]'
+      '--no-bmp-cache[disable bitmap cache]'
+      '--plugin[load a virtual channel plugin]:(cliprdr drdynvc rdpsnd rail rdpdbg rdpdr)'
+      '--rfx[enable RemoteFX]'
+      '--rfx-mode[RemoteFX operational flags]:mode:((v\:video i\:image))'
+      '--nsc[enable NSCodec]'
+      '--disable-wallpaper'
+      '--composition[enable desktop composition]'
+      '--disable-full-window-drag'
+      '--disable-menu-animations'
+      '--disable-theming'
+      '--kbd-list[list all keyboard layout ids used by -k]'
+      '--no-rdp[disable Standard RDP encryption]'
+      '--no-tls[disable TLS encryption]'
+      '--no-nla[disable network level authentication]'
+      '--ntlm[force NTLM authentication protocol version]:version:(1 2)'
+      '--certificate-name[specify logon certificate]:certificate'
+      '--ignore-certificate[ignore verification of logon certificate]'
+      '--sec[force protocol security]:security:(rdp tls nla)'
+      '--secure-checksum[use salted checksums with Standard RDP encryption]'
+      '--version[print version information]'
+    )
+  ;;
+esac
+
+_arguments -C -s $args \
   '-u[username]:username:_users' \
   '-d[domain]:domain' \
   '-s[shell]:startup shell' \
   '-c[working directory]:directory:_directories' \
   '-p[password]:password' \
-  '-n[hostname]:host:_hosts' \
+  '-n[set reported client hostname]:client hostname:_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)' \
+  '-a[colour depth]:depth:(8 15 16 24 32)' \
   '-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

