From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 02b9cc5f for ; Thu, 17 Oct 2019 23:37:24 +0000 (UTC) Received: (qmail 22546 invoked by alias); 17 Oct 2019 23:37:19 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44849 Received: (qmail 5803 invoked by uid 1010); 17 Oct 2019 23:37:19 -0000 X-Qmail-Scanner-Diagnostics: from park01.gkg.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.0/25601. spamassassin: 3.4.2. Clear:RC:0(205.235.26.22):SA:0(-1.6/5.0):. Processed in 2.676242 secs); 17 Oct 2019 23:37:19 -0000 X-Envelope-From: SRS0=O4W7=YK=yahoo.co.uk=okiddle@bounces.park01.gkg.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at bounces.park01.gkg.net designates 205.235.26.22 as permitted sender) X-Virus-Scanned: by amavisd-new at gkg.net Authentication-Results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1571355396; bh=aM0qiIF/+kMp9xoRWQZ7bQY8BrMavVENUh4Zk3nPfWM=; h=From:To:Subject:Date:From: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AwSskdQ82wbhu4DoXOVjYyU3Pfx9who_4ZYEw9 t5b9ntEaKl19RvKwV6LlCgXPZoXnDA1UFVBmfKnXKTH4qxbE1I4wouIGqpFo_LUjTxT4X7nAgk0v ZZ5v9Ve3aQIpNa1XHwApbX97CmbR7H4VlY3baOQAbTKslQMAQqNWp7.4NnJrFBfWePMI7AD8GbYS 0A40RBKkprr42jXzol450664C4oOTHvmrnhCO3N4Y12BEu4uGDobBIiItYGsy__oZ.oZpl__19y_ KcHa4sJuxVj4I348xEJq5X1wzqLNi769fHQYi2h_jLKAJ5xCeLYxmGhGaXDuNZiwNb0c.5HOAmD3 9KW.YjfwraSxu8A38R1ksxlCQjw7mGQhsnMrxj4AXak_b2KCyuwwjJ7oPPTnckOlyl9MBkCPNGI2 AncThV7FaaypRxl0Wgc5CbXpHDwi.BXFM.GzsQHcB8mVGJcQVoXzBLpEB1WRdETxrLofbPwseyM5 wJOmkooAJ9wFn03t4Qexw9rLvxn94lRnu0r1a3P93vFzGmPFYN3HBREp2Os0ZDvQsIB5Lr2NDlJY oVWIEhRaT0RVcaPJhl9EtNvlIPxHhiCVKGBhTHSbF From: Oliver Kiddle To: Zsh workers Subject: PATCH: completion updates for OpenBSD 6.6 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <91123.1571355393.1@hydra> Date: Fri, 18 Oct 2019 01:36:33 +0200 Message-ID: <91124-1571355393.792039@L30N.JQXB.b1RH> This updates some completions for changes in OpenBSD 6.6. Seems they've actually removed old options in date and dhclient. grep gained a couple. vmctl's argument order has changed. And the biggest change is in OpenSSH 8.1 (mostly ssh-keygen) so will be applicable elsewhere. Oliver diff --git a/Completion/BSD/Command/_vmctl b/Completion/BSD/Command/_vmctl index d22657310..873bb5670 100644 --- a/Completion/BSD/Command/_vmctl +++ b/Completion/BSD/Command/_vmctl @@ -42,18 +42,14 @@ else _vm_names ;; create) - if (( CURRENT == 2 )); then - compset -P '(raw|qcow2):' || alts=( - 'prefixes:prefix:compadd -S: raw qcow2' - ) - _alternative 'files:path:_files' $alts - else - shift words; (( CURRENT-- )) - _arguments \ - '-s+[specify size]:size' \ - '(-i)-b+[specify base disk]:base image:_files' - '(-b)-i+[copy and convert input disk]:disk image:_files' - fi + compset -P '(raw|qcow2):' || alts=( + 'prefixes:prefix:compadd -S: raw qcow2' + ) + _arguments \ + '-s+[specify size]:size' \ + '(-i)-b+[specify base disk]:base image:_files' \ + '(-b)-i+[copy and convert input disk]:disk image:_files' \ + '1:disk: _alternative "files:path:_files" $alts' ;; load) _arguments ':configuration file:_files' @@ -72,34 +68,25 @@ else ))' ;; start) - if (( CURRENT == 2 )); then - _vm_names - else - shift words; (( CURRENT-- )) - _arguments -s \ - '-B+[force system to boot from specified device for this boot]:device:(cdrom disk net)' \ - '-b+[boot with the specified kernel or BIOS image]:boot image:_files' \ - '-c[automatically connect to the VM console]' \ - '*-d+[disk image file]:disk image:_files' \ - '-i+[number of network interfaces]:number: ' \ - '-L[add a local network interface]' \ - '-m+[specify memory size]:memory size (megabytes) [512]' \ - '-n+[specify switch to attach]: :_vm_switches' \ - '-r+[specify ISO image file for virtual CD-ROM]:ISO image:_files -g "*.iso(-.)"' \ - '-t+[use existing VM as a template]: :_vm_names' - fi + _arguments -s \ + '-B+[force system to boot from specified device for this boot]:device:(cdrom disk net)' \ + '-b+[boot with the specified kernel or BIOS image]:boot image:_files' \ + '-c[automatically connect to the VM console]' \ + '*-d+[disk image file]:disk image:_files' \ + '-i+[number of network interfaces]:number: ' \ + '-L[add a local network interface]' \ + '-m+[specify memory size]:memory size (megabytes) [512]' \ + '-n+[specify switch to attach]: :_vm_switches' \ + '-r+[specify ISO image file for virtual CD-ROM]:ISO image:_files -g "*.iso(-.)"' \ + '-t+[use existing VM as a template]: :_vm_names' \ + '1: :_vm_names' ;; stop) - if (( CURRENT == 2 )); then - _alternative \ - 'all:all:(-a)' \ - 'virtual-machines: :_vm_names' - else - shift words; (( CURRENT-- )) - _arguments \ - '-f[forcefully stop without attempting a graceful shutdown]' \ - '-w[wait until the VM has been terminated]' - fi + _arguments \ + '(1)-a[stop all running VMs]' \ + '-f[forcefully stop without attempting a graceful shutdown]' \ + '-w[wait until the VM has been terminated]' \ + '(-a)1: :_vm_names' ;; *) _default diff --git a/Completion/Unix/Command/_date b/Completion/Unix/Command/_date index 91bd3b5f1..68bd357fb 100644 --- a/Completion/Unix/Command/_date +++ b/Completion/Unix/Command/_date @@ -40,9 +40,7 @@ else ;| freebsd*|dragonfly*|darwin*|openbsd*) args+=( - '-d+:daylight saving time value' '-f+[use specified format for input]:parsing format:_date_formats:new date' - '-t+:minutes west of GMT' ) ;| dragonfly*|darwin*|netbsd*|openbsd*) @@ -62,8 +60,12 @@ else ) ;| freebsd*|dragonfly*|darwin*) - args+=( "*-v+[adjust and print (but don't set) date]:[+-]value[ymwdHMS]" ) - ;; + args+=( + '-d+:daylight saving time value' + '-t+:minutes west of GMT' + "*-v+[adjust and print (but don't set) date]:[+-]value[ymwdHMS]" + ) + ;| freebsd*|dragonfly*) args+=( '-R[display in RFC2822 format]' ) ;| diff --git a/Completion/Unix/Command/_dhclient b/Completion/Unix/Command/_dhclient index fe5347bbc..d5ca5b271 100644 --- a/Completion/Unix/Command/_dhclient +++ b/Completion/Unix/Command/_dhclient @@ -6,12 +6,12 @@ case $OSTYPE in (open|free)bsd*) args+=( '-c+[specify configuration file]:file:_files' - '-l+[specify leases file]:file:_files' ) ;| freebsd*) args+=( '(-d)-b[immediately move to the background]' + '-l+[specify leases file]:file:_files' '-p+[specify PID file]:file:_files' '-u[reject leases with unknown options]' '-q[quiet]' diff --git a/Completion/Unix/Command/_grep b/Completion/Unix/Command/_grep index d3e1b1a6e..81516b08a 100644 --- a/Completion/Unix/Command/_grep +++ b/Completion/Unix/Command/_grep @@ -109,7 +109,7 @@ case $variant:$OSTYPE in gpl2:*) arguments=( ${${arguments:#*\)-r}/\)-r/\)-R} ) ;; *:openbsd*) arguments=( - ${(M)arguments:#((#s)|*\))--(context|binary-files|line-buffered)*} + ${(M)arguments:#((#s)|*\))--(context|binary-files|line-buffered|label|max-count)*} ${${arguments:#((#s)|*\))(\*|)-[d-]*}/\)-r/\)-R} "-U[search binary files but don't print them]" '-Z[behave as zgrep]' diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index df1fe6ca8..0775590e6 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -3,8 +3,8 @@ # TODO: sshd, ssh-keysign _ssh () { - local curcontext="$curcontext" state line expl suf ret=1 - local args common common_transfer algopt tmp p1 file cmn cmds sdesc tdesc + local curcontext="$curcontext" state line expl suf arg ret=1 + local args sigargs common common_transfer algopt tmp p1 file cmn cmds sdesc tdesc typeset -A opt_args common=( @@ -126,53 +126,71 @@ _ssh () { (( CURRENT == 2 )) && p1='!' args=( '!-z:number' ) sdesc='certify keys with CA key' - (( $+words[(r)-s] )) && args=( '-z[specify serial number]:serial number' ) + (( $+words[(r)-I] )) && args=( '-z[specify serial number]:serial number' ) (( $+words[(r)-[ku]] )) && args=( '-z[specify version number]:version number' ) && sdesc='specify CA public key file' file=key - (( $+words[(r)-[HR]] )) && file=known_hosts + (( $+words[(r)-[FHR]] )) && file=known_hosts (( $+words[(r)-T] )) && file=input - if (( $+words[(r)-[kQ]] )); then + (( $+words[(r)-A] )) && file='prefix for host key' + if (( $+words[(r)-[kIQ]] )); then file=krl args+=( '*:file:_files' ) fi - cmds=( -p -i -e -y -c -l -B -D -H -R -r -G -T -s -L -A -k -Q ) # basic commands - cmn=( -b -P -N -C -m -v ) # options common to many basic commands (except -f which is common to most) - cms=( -E -q -t -g -M -S -a -J -j -K -W -I -h -n -O -V -u ) # options specific to one basic command + if (( arg = $words[(I)-Y*] )); then + [[ $words[arg] = -Y?* ]] || (( arg++ )) + case $words[arg] in + check*|verify) + sigargs+=( "$p1-s+[specify signature file]:signature file:-files" ) + ;| + sign) sigargs+=( '*:file:_files' ) ;; + verify) + args=() + sigargs+=( + '-I+[specify signer identity]:identity' + '-r+[specify revocation file]:revocation file:_files' + ) + ;; + esac + fi + cmds=( -p -i -e -y -c -l -B -D -F -H -R -r -G -T -s -L -A -k -Q -Y ) # basic commands + cmn=( -b -P -N -C -l -m -v ) # options common to many basic commands (except -f which is common to most) + cms=( -E -q -t -g -M -S -a -J -j -K -W -I -h -n -O -V -u -U ) # options specific to one basic command _arguments -s $args \ - "(${${(@)cmds:#-G}} -P -m ${${(@)cms:#-[MS]}})-b+[specify number of bits in key]:bits in key" \ - "$p1(${${(@)cmds:#-[pc]}} -b -C $cms)-P+[provide old passphrase]:old passphrase" \ - "(${${(@)cmds:#-p}} -m -v ${${(@)cms:#-[qt]}})-N+[provide new passphrase]:new passphrase" \ - "(${${(@)cmds:#-c}} -m -v $cms)-C+[provide new comment]:new comment" \ + "(${${(@)cmds:#-G}} -P ${${(@)cms:#-[MS]}})-b+[specify number of bits in key]:bits in key" \ + "$p1(${${(@)cmds:#-[pc]}} -b $cms)-P+[provide old passphrase]:old passphrase" \ + "(${${(@)cmds:#-p}} -v ${${(@)cms:#-[qt]}})-N+[provide new passphrase]:new passphrase" \ + "(${${(@)cmds:#-c}} -v $cms)-C+[provide new comment]:new comment" \ "(-D -G -M -S -I -h -n -O -V -A)-f+[$file file]:$file file:_files" \ - "$p1(${${(@)cmds:#-[ie]}})-m+[specify conversion format]:format:(PEM PKCS7 RFC4716)" \ + "$p1(${${(@)cmds:#-[FE]}} ${${(@)cmn:#-v}} ${${(@)cms:#-E}})-l[show fingerprint of key file]" \ + "$p1(${${(@)cmds:#-[iep]}} $cms)-m+[specify conversion format]:format [RFC4716]:(PEM PKCS8 RFC4716)" \ "(${${(@)cmds:#-[lGT]}} ${${(@)cmn:#-[bv]}} -f)*-v[verbose mode]" \ - '(commands)' \ - "(-b -P -C -v)-p[change passphrase of private key file]" \ - '(-b -P -N -C -v)-i[import key to OpenSSH format]' \ - '(-b -P -N -C -v)-e[export key to SECSH file format]' \ + "(-b -l -C -v)-p[change passphrase of private key file]" \ + '(-b -l -P -N -C -v)-i[import key to OpenSSH format]' \ + '(-b -l -P -N -C -v)-e[export key to SECSH file format]' \ "($cmn)-y[get public key from private key]" \ - '(-b -N -m -v)-c[change comment in private and public key files]' \ + '(-b -l -N -m -v)-c[change comment in private and public key files]' \ "($cmn)-B[show the bubblebabble digest of key]" \ "(-)-D+[download key stored in smartcard reader]:reader" \ + "(${${(@)cmn:#-[lv]}})-F+[search for host in known_hosts file]:host:_ssh_hosts" \ "($cmn)-H[hash names in known_hosts file]" \ "($cmn)-R+[remove host from known_hosts file]:host:_ssh_hosts" \ "($cmn)-L[print the contents of a certificate]" \ - "(-)-A[generate host keys for all key types]" \ + "($cmn -l)-A[generate host keys for all key types]" \ "($cmn)-Q[test whether keys have been revoked in a KRL]" \ - finger \ - "($cmn)-l[show fingerprint of key file]" \ "$p1($cmn)$algopt" \ - create \ - '(-P -m)-q[silence ssh-keygen]' \ - "(-P -m)-t+[specify the type of the key to create]:key type:(rsa dsa ecdsa ed25519)" \ + '(-P -l)-q[silence ssh-keygen]' \ + "(-P -l)-t+[specify the type of the key to create]:key type:(rsa dsa ecdsa ed25519)" \ - dns \ "($cmn)-r[print DNS resource record]:hostname:_hosts" \ "$p1($cmn)-g[use generic DNS format]" \ - primes \ - "(-P -N -C -m -f)-G[generate candidates for DH-GEX moduli]" \ - "$p1(-P -N -C -m -f)-M+[specify amount of memory to use for generating DH-GEX moduli]:memory (MB)" \ - "$p1(-P -N -C -m -f)-S+[specify start point]:start point (hex)" \ + "(-P -N -C -l -m -f)-G+[generate candidates for DH-GEX moduli]:output file:_files" \ + "$p1(-P -N -C -l -m -f)-M+[specify amount of memory to use for generating DH-GEX moduli]:memory (MB)" \ + "$p1(-P -N -C -l -m -f)-S+[specify start point]:start point (hex)" \ - screen \ "(${${(@)cmn:#-v}})-T+[screen candidates for DH-GEX moduli]:output file:_files" \ "${p1}(${${(@)cmn:#-v}})-a+[specify number of rounds]:rounds" \ @@ -182,19 +200,27 @@ _ssh () { "${p1}(${${(@)cmn:#-v}})-W[specify desired generator]:generator" \ - certify \ "($cmn)-s[$sdesc]:CA key:_files" \ - "$p1($cmn -f -u)-I+[specify key identifier to include in certificate]:key id" \ - "$p1($cmn -f -u)-h[generate host certificate instead of a user certificate]" \ - "$p1($cmn -f -u -D)-U[indicate that CA key is held by ssh-agent]" \ - "$p1($cmn -f -u -U)-D+[indicate the CA key is stored in a PKCS#11 token]:PKCS11 shared library:_files -g '*.(so|dylib)(|.<->)(-.)'" \ - "$p1($cmn -f -u)-n+[specify user/host principal names to include in certificate]:principals" \ - "$p1($cmn -f -u)*-O+[specify a certificate option]: : _values 'option' + "$p1($cmn -f -k -u)-I+[specify key identifier to include in certificate]:key id" \ + "$p1($cmn -f -k -u)-h[generate host certificate instead of a user certificate]" \ + "$p1($cmn -f -k -u -D)-U[indicate that CA key is held by ssh-agent]" \ + "$p1($cmn -f -k -u -U)-D+[indicate the CA key is stored in a PKCS#11 token]:PKCS11 shared library:_files -g '*.(so|dylib)(|.<->)(-.)'" \ + "$p1($cmn -f -k -u)-n+[specify user/host principal names to include in certificate]:principals" \ + "$p1($cmn -f -k -u)*-O+[specify a certificate option]: : _values 'option' clear critical\:name extension\:name force-command\:command\:_cmdstring no-agent-forwarding no-port-forwarding no-pty no-user-rc no-x11-forwarding permit-agent-forwarding permit-port-forwarding permit-pty permit-user-rc permit-x11-forwarding source-address\:source\ address" \ "$p1($cmn -f -u)-V+[specify certificate validity interval]:interval" \ - "($cmn -I -h -n -O -V)-k[generate a KRL file]" \ - "$p1($cmn -I -h -n -O -V)-u[update a KRL]" + "($cmn -I -h -n -D -O -U -V)-k[generate a KRL file]" \ + "$p1($cmn -I -h -n -D -O -U -V)-u[update a KRL]" \ + - signature \ + "($cmn)-Y+[signature action]:action:(( + sign\:sign\ a\ file\ using\ SSH\ key + verify\:verify\ a\ signature\ generated\ using\ the\ sign\ option + check-novalidate\:check\ signature\ structure + ))" \ + "$p1-n+[specify namespace]:namespace" \ + $sigargs return ;; ssh-keyscan) @@ -202,6 +228,7 @@ _ssh () { '(-6)-4[force ssh to use IPv4 addresses only]' \ '(-4)-6[force ssh to use IPv6 addresses only]' \ '-c[request certificates from target hosts instead of plain keys]' \ + '-D[print keys found as SSHFP DNS records]' \ '*-f+[read hosts from file, one per line]:file:_files' \ '-H[hash all hostnames and addresses in the output]' \ '-p+[specify port on remote host]:port number on remote host' \ @@ -529,6 +556,7 @@ _ssh () { SendEnv \ ServerAliveCountMax \ ServerAliveInterval \ + SetEnv \ StreamLocalBindMask \ StreamLocalBindUnlink \ StrictHostKeyChecking \