zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: add more options to swaks completion
Date: Fri, 03 Jan 2020 22:53:22 +0100	[thread overview]
Message-ID: <98224-1578088402.826899@ReF5.9OVB.VgF_> (raw)
In-Reply-To: <98224-1578088402.826899.ref@ReF5.9OVB.VgF_>

I needed to use swaks recently including some of the options that aren't
covered by the completion. This adds a few more, mostly TLS related,
options but the function remains incomplete.

Oliver

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]"

           reply	other threads:[~2020-01-03 21:54 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <98224-1578088402.826899.ref@ReF5.9OVB.VgF_>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98224-1578088402.826899@ReF5.9OVB.VgF_ \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).