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 a0b98285 for ; Mon, 22 Apr 2019 02:18:20 +0000 (UTC) Received: (qmail 24164 invoked by alias); 22 Apr 2019 02:18:04 -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: 44242 Received: (qmail 6666 invoked by uid 1010); 22 Apr 2019 02:18:04 -0000 X-Qmail-Scanner-Diagnostics: from mail-oi1-f196.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.1/25426. spamassassin: 3.4.2. Clear:RC:0(209.85.167.196):SA:0(-1.9/5.0):. Processed in 1.616974 secs); 22 Apr 2019 02:18:04 -0000 X-Envelope-From: phy1729@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.167.196 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-disposition:user-agent; bh=3idgYKIXstWl43qu8APLfErMZCqtvIIvLc4ubhyu6+w=; b=L4jmDl5O3m9s+IaOzq9kwp/mojM4aIJAG+46XYZ3Ae4hW4IqjG00aiQFuM+dweg/EP HXKvg0uP8RlDDLsZ4uMgmU0Q+KNUiOVknSyqebW1oV5dnTUJ7Sfpnw07RwpSnwYfsZMo EMgwAf08L/gQIsE9IRUiV1qp9wPmjMcYljwJfAAmJmBlqCl+g29QizlAsa0JIYPr+smV oTTY/ttN4NEAP3Ty2ZinYwOyzD07ZZ9J1kdmh6ijIkqpp5Lh4KrFr33kNA3PShSMn2Kw KxyIjb52E/3A/tXAyi5akkC8f2s0YmNIQZCHOR8XGzZ1nQk6icNMx4wNMbiCvHlI7hwi pcBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :mime-version:content-disposition:user-agent; bh=3idgYKIXstWl43qu8APLfErMZCqtvIIvLc4ubhyu6+w=; b=DjjCkeQ76sH1e2zNhWzYgsq5hBLyIfnL2yMBHhWnw8C+lS9smeTUxvYkFjPqpK/i3T DTaJ4A+RG7SEjNdcdIp0RsDF9Qu//bqfJNvljdmJ/jlhKE9PipvovqQ1vw6cFSbmsVNA 1zU4Xm2zoyIVP/2cRrF61BufRNxfxAj+46M1JbH2y3WyNZfZWuYCOKU9h8pd5UzdyhE3 zA4xTEOWFHhRNx1Msi5H2heen0vxU7IOF1X6DxJuhymzPqy58aFHNn3JHHo667jNM9/w /G7MVvAni8oOxmF6yTXIXBAmZA3cynZOK0p4MQz4x28+cNwnWjExgvo8B8PCl4y6rjVB 8vSw== X-Gm-Message-State: APjAAAWhSB8hReBs5oyavJIskKQ65wt5YMu8lV5h3e++9pNCmi+qARFi 4q2WXJcquMz2oFU9I5dheRhTLckDeMY= X-Google-Smtp-Source: APXvYqyKKYcureTJTba3aOeUtPjZ3hEGs4rWMzZlOjn1mKVA+IpZmPcnZKRsS6ziNzWR50kNiV2GGw== X-Received: by 2002:aca:d8d5:: with SMTP id p204mr9214144oig.26.1555899448056; Sun, 21 Apr 2019 19:17:28 -0700 (PDT) Date: Sun, 21 Apr 2019 21:17:25 -0500 From: Matthew Martin To: zsh-workers@zsh.org Subject: [PATCH] Completion: Use _pick_variant -b to detect builtins Message-ID: <20190422021722.GA60948@CptOrmolo.darkstar> Mail-Followup-To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.11.4 (2019-03-13) Convert completers for loadable builtins in zsh/files to _pick_variant -b to detect if the command is builtin. After this patch I think all completers that should use _pick_variant -b do. --- Completion/Unix/Command/_chown | 97 ++++++++++++++++----------- Completion/Unix/Command/_ln | 115 ++++++++++++++++----------------- Completion/Unix/Command/_mv | 86 +++++++++++++----------- Completion/Unix/Command/_rm | 86 +++++++++++++----------- Completion/Unix/Command/_rmdir | 28 +++++--- 5 files changed, 234 insertions(+), 178 deletions(-) diff --git a/Completion/Unix/Command/_chown b/Completion/Unix/Command/_chown index a97a0e0bf..8fde02096 100644 --- a/Completion/Unix/Command/_chown +++ b/Completion/Unix/Command/_chown @@ -1,43 +1,68 @@ #compdef chown chgrp gchown=chown gchgrp=chgrp zf_chown=chown zf_chgrp=chgrp -local curcontext="$curcontext" state line expl ret=1 +local curcontext="$curcontext" state line expl ret=1 variant local suf usr grp req deref pattern arg args -if _pick_variant gnu=Free\ Soft unix --version; then - args=( - '(-c --changes -v --verbose)'{-c,--changes}'[report each change made]' - '(-c --changes -v --verbose)'{-v,--verbose}'[output info for every file processed]' - '(-h --no-dereference)--dereference[dereference symlinks]' - '(-h --no-dereference --dereference)'{-h,--no-dereference}'[operate on symlinks themselves]' - '(-f --silent --quiet)'{-f,--silent,--quiet}"[don't report errors]" - '--preserve-root[fail to operate recursively on /]' - '--reference=[copy ownership of specified file]:file:_files' - '(-R --recursive)'{-R,--recursive}'[change files and directories recursively]' - '(-H -L -P)-L[follow all symlinks]' - '(-H -L -P)-H[follow symlinks on the command line]' - '(-H -L -P)-P[do not follow symlinks (default)]' - '(- : *)--help[display help information]' - '(- : *)--version[display version information]' - ) - [[ $service = chown ]] && - args+=( '--from=[restrict changes to files by current ownership]: :->owner' ) -else - args=( - "-h[operate on symlinks them self]" - '-R[change files and directories recursively]' - '(-H -L -P)-L[follow all symlinks]' - '(-H -L -P)-H[follow symlinks on the command line]' - '(-H -L -P)-P[do not follow symlinks (default)]' - ) - for pattern arg in \ - '(dragonfly|freebsd)*' "-x[don't traverse file systems]" \ - '(darwin|dragonfly|(free|net)bsd|solaris)*' "-f[don't report errors]" \ - '(darwin|dragonfly|(free|net)bsd)*' '-v[output info for every file processed]' \ - 'solaris2.<11->' '-s[owner and/or group are Windows SID strings]' - do - [[ $OSTYPE = $~pattern ]] && args+=( $arg ) - done -fi +_pick_variant -r variant -b zsh gnu=Free\ Soft $OSTYPE --version +case "$variant" in + gnu) + args=( + '(-c --changes -v --verbose)'{-c,--changes}'[report each change made]' + '(-c --changes -v --verbose)'{-v,--verbose}'[output info for every file processed]' + '(-h --no-dereference)--dereference[dereference symlinks]' + '(-h --no-dereference --dereference)'{-h,--no-dereference}'[operate on symlinks themselves]' + '(-f --silent --quiet)'{-f,--silent,--quiet}"[don't report errors]" + '--preserve-root[fail to operate recursively on /]' + '--reference=[copy ownership of specified file]:file:_files' + '(-R --recursive)'{-R,--recursive}'[change files and directories recursively]' + '(-H -L -P)-L[follow all symlinks]' + '(-H -L -P)-H[follow symlinks on the command line]' + '(-H -L -P)-P[do not follow symlinks (default)]' + '(- : *)--help[display help information]' + '(- : *)--version[display version information]' + ) + [[ $service = chown ]] && + args+=( '--from=[restrict changes to files by current ownership]: :->owner' ) + ;; + *) + args=( + '-h[operate on symlinks them self]' + '-R[change files and directories recursively]' + ) + ;| + zsh) + args+=( + '-s[enable paranoid behavior]' + ) + ;; + *) + args+=( + '(-H -L -P)-L[follow all symlinks]' + '(-H -L -P)-H[follow symlinks on the command line]' + '(-H -L -P)-P[do not follow symlinks (default)]' + ) + ;| + dragonfly*|freebsd*) + args+=( + "-x[don't traverse file systems]" + ) + ;| + darwin*|dragonfly*|freebsd*|netbsd*|solaris*) + args+=( + "-f[don't report errors]" + ) + ;| + darwin*|dragonfly*|freebsd*|netbsd*) + args+=( + '-v[output info for every file processed]' + ) + ;| + solaris2.<11->) + args+=( + '-s[owner and/or group are Windows SID strings]' + ) + ;; +esac (( $+words[(r)--reference*] )) || args+=( '(--reference)1: :->owner' ) _arguments -C -s "$args[@]" '*: :->files' && ret=0 diff --git a/Completion/Unix/Command/_ln b/Completion/Unix/Command/_ln index 3c1dcac76..339d327fe 100644 --- a/Completion/Unix/Command/_ln +++ b/Completion/Unix/Command/_ln @@ -1,6 +1,6 @@ #compdef ln gln zf_ln -local curcontext="$curcontext" state line ret=1 +local curcontext="$curcontext" state line ret=1 variant local -A opt_args local -a args opts @@ -9,67 +9,66 @@ args=( '-s[create symbolic links instead of hard links]' ) -local variant -_pick_variant -r variant gnu=gnu unix --help -if [[ $variant == gnu ]]; then - opts=(-S) - args=( - '(-b --backup)-b[create a backup of each existing destination file]' \ - '(-b --backup)--backup=[create a backup of each existing destination file]::method:(( - none\:"never create backups" - off\:"never create backups" - numbered\:"create numbered backup" - t\:"create numbered backup" - existing\:"same as numbered if numbered backups exist, otherwise same as simple" - nil\:"same as numbered if numbered backups exist, otherwise same as simple" - simple\:"always create simple backups" - never\:"always create simple backups"))' - '(-d -F --directory)'{-d,-F,--directory}'[allow the superuser to attempt to hard link directories]' - '(-f --force)'{-f,--force}'[remove existing destination files]' - '(-i --interactive)'{-i,--interactive}'[prompt before removing destination files]' - '(-L --logical)'{-L,--logical}'[create hard links to symbolic link references]' - '(-n --no-dereference)'{-n,--no-dereference}'[treat destination symbolic link to a directory as if it were a normal file]' - '(-P --physical)'{-P,--physical}'[create hard links directly to symbolic links]' - '(-r --relative)'{-r,--relative}'[create symbolic links relative to link location]' - '(-s --symbolic)'{-s,--symbolic}'[create symbolic links instead of hard links]' - '(-S --suffix)'{-S,--suffix=}'[override default backup suffix]:suffix' - '(-t --target-directory)'{-t,--target-directory=}'[specify directory in which to create the links]: :_directories' - '(-T --no-target-directory)'{-T,--no-target-directory}'[treat destination as a normal file]' - '(-v --verbose)'{-v,--verbose}'[print name of each linked file]' - '--help[display usage information and exit]' - '--version[display version information and exit]') -elif (( ${+builtins[ln]} )); then - args+=( - '-d[attempt to hard link directories]' - {-h,-n}'[do not dereference destination]' - '(-f)-i[prompt before removing destination files]') -else - case $OSTYPE in - darwin*|dragonfly*|freebsd*|netbsd*|openbsd*) - args+=( - {-h,-n}'[do not dereference destination]' - ) +_pick_variant -r variant -b zsh gnu=gnu $OSTYPE --help +case $variant; in + gnu) + opts=(-S) + args=( + '(-b --backup)-b[create a backup of each existing destination file]' \ + '(-b --backup)--backup=[create a backup of each existing destination file]::method:(( + none\:"never create backups" + off\:"never create backups" + numbered\:"create numbered backup" + t\:"create numbered backup" + existing\:"same as numbered if numbered backups exist, otherwise same as simple" + nil\:"same as numbered if numbered backups exist, otherwise same as simple" + simple\:"always create simple backups" + never\:"always create simple backups"))' + '(-d -F --directory)'{-d,-F,--directory}'[allow the superuser to attempt to hard link directories]' + '(-f --force)'{-f,--force}'[remove existing destination files]' + '(-i --interactive)'{-i,--interactive}'[prompt before removing destination files]' + '(-L --logical)'{-L,--logical}'[create hard links to symbolic link references]' + '(-n --no-dereference)'{-n,--no-dereference}'[treat destination symbolic link to a directory as if it were a normal file]' + '(-P --physical)'{-P,--physical}'[create hard links directly to symbolic links]' + '(-r --relative)'{-r,--relative}'[create symbolic links relative to link location]' + '(-s --symbolic)'{-s,--symbolic}'[create symbolic links instead of hard links]' + '(-S --suffix)'{-S,--suffix=}'[override default backup suffix]:suffix' + '(-t --target-directory)'{-t,--target-directory=}'[specify directory in which to create the links]: :_directories' + '(-T --no-target-directory)'{-T,--no-target-directory}'[treat destination as a normal file]' + '(-v --verbose)'{-v,--verbose}'[print name of each linked file]' + '--help[display usage information and exit]' + '--version[display version information and exit]') + ;; + zsh) + args+=( + '-d[attempt to hard link directories]' + {-h,-n}'[do not dereference destination]' + '(-f)-i[prompt before removing destination files]') + ;; + darwin*|dragonfly*|freebsd*|netbsd*|openbsd*) + args+=( + {-h,-n}'[do not dereference destination]' + ) ;| - darwin*|dragonfly*|freebsd*|netbsd*) - args+=( - '-F[remove existing destination directories]' - '(-f)-i[prompt before removing destination files]' - '-v[print name of each linked file]' - ) + darwin*|dragonfly*|freebsd*|netbsd*) + args+=( + '-F[remove existing destination directories]' + '(-f)-i[prompt before removing destination files]' + '-v[print name of each linked file]' + ) ;| - dragonfly*|freebsd*|netbsd*|openbsd*) - args+=( - '(-L)-P[create hard links directly to symbolic links]' - '(-P)-L[create hard links to symbolic link references]' - ) + dragonfly*|freebsd*|netbsd*|openbsd*) + args+=( + '(-L)-P[create hard links directly to symbolic links]' + '(-P)-L[create hard links to symbolic link references]' + ) ;| - dragonfly*|freebsd*) - args+=( - "-w[warn if source of a symbolic link doesn't currently exist]" - ) + dragonfly*|freebsd*) + args+=( + "-w[warn if source of a symbolic link doesn't currently exist]" + ) ;; - esac -fi +esac _arguments -C -s $opts : \ $args \ diff --git a/Completion/Unix/Command/_mv b/Completion/Unix/Command/_mv index 3592efee6..2f0f844d4 100644 --- a/Completion/Unix/Command/_mv +++ b/Completion/Unix/Command/_mv @@ -1,42 +1,54 @@ #compdef mv gmv -local args -if _pick_variant gnu=GNU unix --version; then - args=( - '(-b --backup -n --no-clobber)--backup=[make a backup of each existing destination file]: : _values "backup type" - {none,off}"[never make backups]" - {numbered,t}"[make numbered backups]" - {existing,nil}"[numbered backups, if they already exist]" - {simple,never}"[always make simple backups]"' - '(-b --backup -n --no-clobber)-b[make a backup of each existing destination file]' - '(-f --force -i --interactive -n --no-clobber)'{-f,--force}"[don't prompt before overwriting]" - '(-f --force -i --interactive -n --no-clobber)'{-i,--interactive}'[prompt before overwriting existing file]' - '--strip-trailing-slashes[remove any trailing slashes from each source argument]' - '(-S --suffix)'{-S+,--suffix=}'[specify the backup suffix]:backup suffix [~]' - '(-t --target-directory)'{-t+,--target-directory=}'[move all source arguments into specified directory]:directory:_directories' - '(-T --no-target-directory)'{-T,--no-target-directory}'[treat final argument as a normal file]' - '(-u --update)'{-u,--update}'[move only when destination file is older or missing]' - '(-v --verbose)'{-v,--verbose}'[show file names after they are moved]' - '(- *)--help[display usage information]' - '(- *)--version[display version information]' - ) - [[ $OSTYPE = linux* ]] && args+=( - '(-Z --context)'{-Z,--context}'[set SELinux security context of destination file to default type]' - ) -else - local pattern arg - args=( - "(-i -n)-f[don't prompt before overwriting]" - '(-f -n)-i[prompt before overwriting existing file]' - ) - for pattern arg in \ - '(darwin|dragonfly|freebsd)*' "(-f -i)-n[don't overwrite existing file]" \ - '(darwin|dragonfly|*bsd)*' '-v[show file names after they are moved]' \ - '(dragonfly|freebsd)*' "-h[if target is a symlink to a directory, don't follow it]" - do - [[ $OSTYPE = $~pattern ]] && args+=( $arg ) - done -fi +local args variant + +_pick_variant -r variant -b zsh gnu=GNU $OSTYPE --version +case $variant; in + gnu) + args=( + '(-b --backup -n --no-clobber)--backup=[make a backup of each existing destination file]: : _values "backup type" + {none,off}"[never make backups]" + {numbered,t}"[make numbered backups]" + {existing,nil}"[numbered backups, if they already exist]" + {simple,never}"[always make simple backups]"' + '(-b --backup -n --no-clobber)-b[make a backup of each existing destination file]' + '(-f --force -i --interactive -n --no-clobber)'{-f,--force}"[don't prompt before overwriting]" + '(-f --force -i --interactive -n --no-clobber)'{-i,--interactive}'[prompt before overwriting existing file]' + '--strip-trailing-slashes[remove any trailing slashes from each source argument]' + '(-S --suffix)'{-S+,--suffix=}'[specify the backup suffix]:backup suffix [~]' + '(-t --target-directory)'{-t+,--target-directory=}'[move all source arguments into specified directory]:directory:_directories' + '(-T --no-target-directory)'{-T,--no-target-directory}'[treat final argument as a normal file]' + '(-u --update)'{-u,--update}'[move only when destination file is older or missing]' + '(-v --verbose)'{-v,--verbose}'[show file names after they are moved]' + '(- *)--help[display usage information]' + '(- *)--version[display version information]' + ) + [[ $OSTYPE = linux* ]] && args+=( + '(-Z --context)'{-Z,--context}'[set SELinux security context of destination file to default type]' + ) + ;; + *) + args=( + "(-i -n)-f[don't prompt before overwriting]" + '(-f -n)-i[prompt before overwriting existing file]' + ) + ;| + darwin*|dragonfly*|freebsd*) + args+=( + "(-f -i)-n[don't overwrite existing file]" + ) + ;| + darwin*|dragonfly*|*bsd*) + args+=( + '-v[show file names after they are moved]' + ) + ;| + dragonfly*|freebsd*) + args+=( + "-h[if target is a symlink to a directory, don't follow it]" + ) + ;; +esac _arguments -s -S $args \ '*:file:_files' diff --git a/Completion/Unix/Command/_rm b/Completion/Unix/Command/_rm index aa24a3fd6..dfd3a394a 100644 --- a/Completion/Unix/Command/_rm +++ b/Completion/Unix/Command/_rm @@ -1,5 +1,6 @@ #compdef rm grm zf_rm +local variant declare -a opts args args=( '(-f --force)'{-f,--force}'[ignore nonexistent files, never prompt]' @@ -7,47 +8,58 @@ args=( '(-r -R --recursive)'{-r,-R,--recursive}'[remove directories and their contents recursively]' '*:: :->file' ) -if _pick_variant gnu=gnu unix --help; then - opts+=(-S) - args+=( - '(-i --interactive)-I[prompt when removing many files]' - '(-i -I)--interactive=-[prompt under given condition (defaulting to always)]::when:((once\:"prompt when removing many files" - always\:"prompt before every removal"))' - '--one-file-system[stay within filesystems of files given as arguments]' - '( --preserve-root)--no-preserve-root[do not treat / specially]' - '(--no-preserve-root )--preserve-root[do not remove / (default)]' - '(-d --dir)'{-d,--dir}'[remove directories as well]' - '(-v --verbose)'{-v,--verbose}'[explain what is being done]' - '(- *)--help[display help message and exit]' - '(- *)--version[output version information and exit]' - ) -else - args=(${args:#*)--*\[*}) - case $OSTYPE in - darwin*|dragonfly*|freebsd*|netbsd*|openbsd*) - args+=( - '-d[remove directories as well]' - '-P[overwrite files before deleting them]' - '-v[explain what is being done]' - ) +_pick_variant -r variant -b zsh gnu=gnu $OSTYPE --help +case $variant; in + gnu) + opts+=(-S) + args+=( + '(-i --interactive)-I[prompt when removing many files]' + '(-i -I)--interactive=-[prompt under given condition (defaulting to always)]::when:((once\:"prompt when removing many files" + always\:"prompt before every removal"))' + '--one-file-system[stay within filesystems of files given as arguments]' + '( --preserve-root)--no-preserve-root[do not treat / specially]' + '(--no-preserve-root )--preserve-root[do not remove / (default)]' + '(-d --dir)'{-d,--dir}'[remove directories as well]' + '(-v --verbose)'{-v,--verbose}'[explain what is being done]' + '(- *)--help[display help message and exit]' + '(- *)--version[output version information and exit]' + ) + ;; + *) + args=(${args:#*)--*\[*}) + ;| + darwin*|dragonfly*|freebsd*|netbsd*|openbsd*|zsh) + args+=( + '-d[remove directories as well]' + ) ;| - darwin*|dragonfly*|freebsd*|netbsd*) - args+=( - '-W[attempt to undelete named files]' - ) + zsh) + args+=( + '-s[enable paranoid behavior]' + ) + ;; + darwin*|dragonfly*|freebsd*|netbsd*|openbsd*) + args+=( + '-P[overwrite files before deleting them]' + '-v[explain what is being done]' + ) ;| - dragonfly*|freebsd*|netbsd*) - args+=( - "-x[don't cross file systems when removing a hierarchy]" - ) + darwin*|dragonfly*|freebsd*|netbsd*) + args+=( + '-W[attempt to undelete named files]' + ) ;| - dragonfly*|freebsd*) - args+=( - '(-i)-I[prompt when removing many files]' - ) + dragonfly*|freebsd*|netbsd*) + args+=( + "-x[don't cross file systems when removing a hierarchy]" + ) + ;| + dragonfly*|freebsd*) + args+=( + '(-i)-I[prompt when removing many files]' + ) ;; - esac -fi +esac local curcontext=$curcontext state line ret=1 declare -A opt_args diff --git a/Completion/Unix/Command/_rmdir b/Completion/Unix/Command/_rmdir index 0f5e16912..2ae0fd9b2 100644 --- a/Completion/Unix/Command/_rmdir +++ b/Completion/Unix/Command/_rmdir @@ -1,22 +1,30 @@ #compdef rmdir grmdir +local variant local -a args args=( '(-p --parents)'{-p,--parents}'[remove each component of the specified paths]' ) -if _pick_variant gnu=GNU unix --version; then - args+=( - '--ignore-fail-on-non-empty[ignore failure if directory is non-empty]' - '(-v --verbose)'{-v,--verbose}'[be verbose]' - ) -else - args=(${args:#*\)--*}) - if [[ $OSTYPE == (dragonfly|freebsd)* ]]; then +_pick_variant -r variant -b zsh gnu=GNU $OSTYPE --version +case $variant; in + gnu) + args+=( + '--ignore-fail-on-non-empty[ignore failure if directory is non-empty]' + '(-v --verbose)'{-v,--verbose}'[be verbose]' + ) + ;; + zsh) + args=() + ;; + *) + args=(${args:#*\)--*}) + ;| + dragonfly*|freebsd*) args+=('-v[be verbose]') - fi -fi + ;; +esac _arguments -s -S -A '-*' \ $args \ -- 2.21.0