summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <okiddle@yahoo.co.uk>2020-01-03 23:02:52 +0100
committerOliver Kiddle <okiddle@yahoo.co.uk>2020-01-03 23:02:52 +0100
commit6170cd0c17c22072f6c3e4ebb508d2404b098a90 (patch)
treef29c78ca919ce36eda2171f9c09c791ba9781dbe
parente6c5482dd8546c62704d14492f302353b16d8245 (diff)
downloadzsh-6170cd0c17c22072f6c3e4ebb508d2404b098a90.tar.gz
zsh-6170cd0c17c22072f6c3e4ebb508d2404b098a90.tar.xz
zsh-6170cd0c17c22072f6c3e4ebb508d2404b098a90.zip
45218: add more options to swaks completion
-rw-r--r--ChangeLog2
-rw-r--r--Completion/Unix/Command/_swaks22
2 files changed, 21 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 574dfa786..6f307de9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2020-01-03  Oliver Kiddle  <okiddle@yahoo.co.uk>
 
+	* 45218: Completion/Unix/Command/_swaks: add more options
+
 	* 45196: Completion/Unix/Command/_make: fix completion after
 	make -C, allowing for -C being used multiple times
 
diff --git a/Completion/Unix/Command/_swaks b/Completion/Unix/Command/_swaks
index a0ffb53ad..0e92221bd 100644
--- a/Completion/Unix/Command/_swaks
+++ b/Completion/Unix/Command/_swaks
@@ -1,5 +1,8 @@
 #compdef swaks
 
+local ign
+
+(( $#words > 2 )) && ign='!'
 _arguments \
   '(-s --server -p --port)'{-s+,--server=}'[target host[:port\]]:host[\:port]:_hosts' \
   '(-p --port)'{-p+,--port=}'[target port number]:port number:(25 465 587)' \
@@ -27,14 +30,27 @@ _arguments \
       ESMTPS\:EHLO\ STARTTLS\ 25
       ESMTPSA\:EHLO\ STARTTLS\ 25\ authenticated
       ))' \
-  '-tls[TLS required]' \
-  '(-tlsos --tls-optional-strict)'{-tlsos,--tls-optional-strict}'[TLS iff offered by target]' \
+  '(-tls -tlsos --tls-optional-strict)-tls[TLS required]' \
+  '(-tls -tlsos --tls-optional-strict)'{-tlsos,--tls-optional-strict}'[TLS iff offered by target]' \
   '(-tlsc --tls-on-connect)'{-tlsc,--tls-on-connect}'[TLS on connect (port 465)]' \
   '(-tlsp --tls-protocol)'{-tlsp,--tls-protocol=}':TLS protocol:(sslv2 sslv3 tlsv1 tlsv1_1 tlsv1_2)' \
   '-tls-cipher:OpenSSL cipher string: ' \
   '--tls-verify[verify TLS certificates]' \
   '--tls-ca-path=:OpenSSL CAfile or CAdir:_files' \
   '--tls-get-peer-cert=-:file to write (omit for STDOUT)' \
+  '(-a --auth -ao --auth-optional -aos --auth-optional-strict)'{-a+,--auth=}'[use authentication, failing if no common auth-types found]::auth type:_sequence compadd - LOGIN PLAIN CRAM-MD5 DIGEST-MD5 CRAM-SHA1 NTLM SPA MSN' \
+  '(-a --auth -ao --auth-optional -aos --auth-optional-strict)'{-ao,--auth-optional=}'[use authentication if common auth-types found]::auth type:_sequence compadd - LOGIN PLAIN CRAM-MD5 DIGEST-MD5 CRAM-SHA1 NTLM SPA MSN' \
+  '(-a --auth -ao --auth-optional -aos --auth-optional-strict)'{-aos,--auth-optional-strict=}'[use authentication]::auth type:_sequence compadd - LOGIN PLAIN CRAM-MD5 DIGEST-MD5 CRAM-SHA1 NTLM SPA MSN' \
+  '(-ap --auth-password)'{-ap,--auth-password=}'[provide the password to be used for authentication]::password' \
+  \*{-ae,--auth-extra=}'[add extra information to authentication process]: :_values keywords
+	{realm,domain,dmd5-{serv-type,host,serv-name}}\:value' \
+  \*{-am,--auth-map=}'[map alternate names for authentication types]:alias=type,...' \
+  '(-apt --auth-plaintext)'{-apt,--auth-plaintext}'[show auth strings in plaintext when printing on screen]' \
+  '(-ahp --auth-hide-password)'{-ahp,--auth-hide-password}'[replace passwords with dummy string when printing to terminal]' \
   '(-d --data)'{-d+,--data=}'[specify DATA payload]:filename (or string with tokens):_files' \
   '*'{-ah,--add-header=}'[add headers]:<Header>\: Value' \
-  '*'{-h,--header=}'[replace headers]:<Header>\: Value'
+  '*'{-h,--header=}'[replace headers]:<Header>\: Value' \
+  "${ign}(-)--support[display capabilities and exit]" \
+  "--dump[display results of option processing but send no mail]" \
+  "${ign}(-)--help[display usage information]" \
+  "${ign}(-)--version[display version information]"