summaryrefslogtreecommitdiffstats
path: root/Completion
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2025-11-24 22:08:46 +0100
committerOliver Kiddle <opk@zsh.org>2025-11-24 22:10:27 +0100
commit5a1cbabead83d2479531579063a4540df6795d3d (patch)
tree83029e9b47f914fe67260adc46ccb9b660f385a8 /Completion
parent54092 (tweaked): _git: improve format completion (diff)
downloadzsh-5a1cbabead83d2479531579063a4540df6795d3d.tar
zsh-5a1cbabead83d2479531579063a4540df6795d3d.tar.gz
zsh-5a1cbabead83d2479531579063a4540df6795d3d.tar.bz2
zsh-5a1cbabead83d2479531579063a4540df6795d3d.tar.lz
zsh-5a1cbabead83d2479531579063a4540df6795d3d.tar.xz
zsh-5a1cbabead83d2479531579063a4540df6795d3d.tar.zst
zsh-5a1cbabead83d2479531579063a4540df6795d3d.zip
54094: handle rust coreutils in completions
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_base644
-rw-r--r--Completion/Unix/Command/_basename2
-rw-r--r--Completion/Unix/Command/_cat2
-rw-r--r--Completion/Unix/Command/_chmod2
-rw-r--r--Completion/Unix/Command/_chown2
-rw-r--r--Completion/Unix/Command/_chroot2
-rw-r--r--Completion/Unix/Command/_cksum2
-rw-r--r--Completion/Unix/Command/_comm2
-rw-r--r--Completion/Unix/Command/_cp2
-rw-r--r--Completion/Unix/Command/_csplit2
-rw-r--r--Completion/Unix/Command/_cut2
-rw-r--r--Completion/Unix/Command/_date2
-rw-r--r--Completion/Unix/Command/_dd2
-rw-r--r--Completion/Unix/Command/_df2
-rw-r--r--Completion/Unix/Command/_du2
-rw-r--r--Completion/Unix/Command/_env2
-rw-r--r--Completion/Unix/Command/_fmt14
-rw-r--r--Completion/Unix/Command/_fold2
-rw-r--r--Completion/Unix/Command/_head2
-rw-r--r--Completion/Unix/Command/_id2
-rw-r--r--Completion/Unix/Command/_install2
-rw-r--r--Completion/Unix/Command/_join2
-rw-r--r--Completion/Unix/Command/_ln2
-rw-r--r--Completion/Unix/Command/_ls2
-rw-r--r--Completion/Unix/Command/_mkdir2
-rw-r--r--Completion/Unix/Command/_mkfifo2
-rw-r--r--Completion/Unix/Command/_mknod2
-rw-r--r--Completion/Unix/Command/_mktemp2
-rw-r--r--Completion/Unix/Command/_mv2
-rw-r--r--Completion/Unix/Command/_nice2
-rw-r--r--Completion/Unix/Command/_nl2
-rw-r--r--Completion/Unix/Command/_od2
-rw-r--r--Completion/Unix/Command/_paste2
-rw-r--r--Completion/Unix/Command/_pr2
-rw-r--r--Completion/Unix/Command/_readlink2
-rw-r--r--Completion/Unix/Command/_rm2
-rw-r--r--Completion/Unix/Command/_rmdir4
-rw-r--r--Completion/Unix/Command/_seq2
-rw-r--r--Completion/Unix/Command/_sort2
-rw-r--r--Completion/Unix/Command/_split2
-rw-r--r--Completion/Unix/Command/_stat2
-rw-r--r--Completion/Unix/Command/_stdbuf2
-rw-r--r--Completion/Unix/Command/_tac2
-rw-r--r--Completion/Unix/Command/_tail2
-rw-r--r--Completion/Unix/Command/_tee2
-rw-r--r--Completion/Unix/Command/_touch2
-rw-r--r--Completion/Unix/Command/_tr2
-rw-r--r--Completion/Unix/Command/_truncate2
-rw-r--r--Completion/Unix/Command/_tty2
-rw-r--r--Completion/Unix/Command/_uname2
-rw-r--r--Completion/Unix/Command/_unexpand2
-rw-r--r--Completion/Unix/Command/_uniq2
-rw-r--r--Completion/Unix/Command/_wc2
-rw-r--r--Completion/Unix/Command/_who2
54 files changed, 68 insertions, 56 deletions
diff --git a/Completion/Unix/Command/_base64 b/Completion/Unix/Command/_base64
index 47a650343..bbf100acb 100644
--- a/Completion/Unix/Command/_base64
+++ b/Completion/Unix/Command/_base64
@@ -8,7 +8,7 @@
local variant type=base${service//[^2346]/}
_pick_variant -r variant \
- gnu='Free Soft' fourmilab=fourmi darwin=-D unix --version
+ gnu='(Free Soft|uutils)' fourmilab=fourmi darwin=-D unix --version
case $variant in
gnu)
@@ -19,7 +19,7 @@ case $variant in
'(enc -d --decode)'{-d,--decode}"[decode input from $type]" \
'(enc -i --ignore-garbage)'{-i,--ignore-garbage}'[ignore irrelevant characters when decoding]' \
+ '(enc)' \
- '(dec)'{-w+,--wrap=}'[wrap encoded lines at specified number of columns]:number of columns' \
+ '(dec)'{-w+,--wrap=}'[wrap encoded lines at specified number of columns]:number of columns [76]' \
+ in \
'1:input file:_files'
return
diff --git a/Completion/Unix/Command/_basename b/Completion/Unix/Command/_basename
index a826b56b0..9169c0f12 100644
--- a/Completion/Unix/Command/_basename
+++ b/Completion/Unix/Command/_basename
@@ -1,7 +1,7 @@
#compdef basename gbasename
local args variant
-_pick_variant -r variant gnu=GNU $OSTYPE --version
+_pick_variant -r variant gnu='(GNU|uutils)' $OSTYPE --version
case $variant in
gnu)
diff --git a/Completion/Unix/Command/_cat b/Completion/Unix/Command/_cat
index 526c49e31..78c35653c 100644
--- a/Completion/Unix/Command/_cat
+++ b/Completion/Unix/Command/_cat
@@ -2,7 +2,7 @@
local -a args
-if _pick_variant gnu=GNU unix --version; then
+if _pick_variant gnu='(GNU|uutils)' unix --version; then
args=(
'(-A --show-all)'{-A,--show-all}'[equivalent to -vET]'
'(-b --number-nonblank -n --number)'{-b,--number-nonblank}'[number nonempty output lines, overrides -n]'
diff --git a/Completion/Unix/Command/_chmod b/Completion/Unix/Command/_chmod
index 5ec60d707..f0bde2dcb 100644
--- a/Completion/Unix/Command/_chmod
+++ b/Completion/Unix/Command/_chmod
@@ -8,7 +8,7 @@ aopts=( -A '-[^gorstuwxX]*' )
args=( '*: :->files' '1: :_file_modes' )
-_pick_variant -r variant -b zsh gnu=Free\ Soft $OSTYPE --version
+_pick_variant -r variant -b zsh gnu='(Free Soft|uutils)' $OSTYPE --version
case "$variant" in
zsh)
# Assign, not append because zf_chmod only supports octal modes.
diff --git a/Completion/Unix/Command/_chown b/Completion/Unix/Command/_chown
index c9fe8fadd..dae0de86c 100644
--- a/Completion/Unix/Command/_chown
+++ b/Completion/Unix/Command/_chown
@@ -3,7 +3,7 @@
local curcontext="$curcontext" state line expl ret=1 variant
local suf usr grp req deref pattern arg args aopts=( -A '-*' )
-_pick_variant -r variant -b zsh gnu=Free\ Soft $OSTYPE --version
+_pick_variant -r variant -b zsh gnu='(Free Soft|uutils)' $OSTYPE --version
case "$variant" in
gnu)
aopts=()
diff --git a/Completion/Unix/Command/_chroot b/Completion/Unix/Command/_chroot
index a9c577bd7..9fb2ed419 100644
--- a/Completion/Unix/Command/_chroot
+++ b/Completion/Unix/Command/_chroot
@@ -4,7 +4,7 @@ local variant ret=1
local -a context line state state_descr args
local -A opt_args
-_pick_variant -r variant gnu='Free Soft' unix --version
+_pick_variant -r variant gnu='(Free Soft|uutils)' unix --version
variant+=-$OSTYPE
diff --git a/Completion/Unix/Command/_cksum b/Completion/Unix/Command/_cksum
index 67f2a7896..c50b8ae0d 100644
--- a/Completion/Unix/Command/_cksum
+++ b/Completion/Unix/Command/_cksum
@@ -25,7 +25,7 @@
local -a args
-_pick_variant gnu='Free Soft' unix --version && {
+_pick_variant gnu='(Free Soft|uutils)' unix --version && {
args=(
'*: :_files'
'(: -)--help[display help information]'
diff --git a/Completion/Unix/Command/_comm b/Completion/Unix/Command/_comm
index f8c535a44..9bd54552f 100644
--- a/Completion/Unix/Command/_comm
+++ b/Completion/Unix/Command/_comm
@@ -10,7 +10,7 @@ args=(
'2:file to compare:_files'
)
-if _pick_variant gnu=GNU unix --version; then
+if _pick_variant gnu='(GNU|uutils)' unix --version; then
aopts=( )
args+=(
'(--nocheck-order)--check-order[check input is correctly sorted]'
diff --git a/Completion/Unix/Command/_cp b/Completion/Unix/Command/_cp
index cb899cc28..0263115b3 100644
--- a/Completion/Unix/Command/_cp
+++ b/Completion/Unix/Command/_cp
@@ -1,6 +1,6 @@
#compdef cp gcp
-if _pick_variant gnu=GNU unix --version; then
+if _pick_variant gnu='(GNU|uutils)' unix --version; then
_arguments -s -S \
'(-a --archive)'{-a,--archive}'[archive mode, same as -dR --preserve=all]' \
"--attributes-only[don't copy file data, just attributes]" \
diff --git a/Completion/Unix/Command/_csplit b/Completion/Unix/Command/_csplit
index 5f72232bb..b0ba1d7f4 100644
--- a/Completion/Unix/Command/_csplit
+++ b/Completion/Unix/Command/_csplit
@@ -14,7 +14,7 @@ specs=(
'(hv)*: :->patterns'
)
-if _pick_variant gnu=GNU unix --version; then
+if _pick_variant gnu='(GNU|uutils)' unix --version; then
# GNU coreutils 8.32
specs+=(
'(hv -b --suffix-format -n --digits)'{-b+,--suffix-format=}'[specify format for numbers in output file names]:format [%%02d]: '
diff --git a/Completion/Unix/Command/_cut b/Completion/Unix/Command/_cut
index 778439cf1..152894a6c 100644
--- a/Completion/Unix/Command/_cut
+++ b/Completion/Unix/Command/_cut
@@ -32,7 +32,7 @@ case $LANG in
;;
esac
-if _pick_variant gnu="Free Soft" unix --version; then
+if _pick_variant gnu='(Free Soft|uutils)' unix --version; then
_arguments \
'(--bytes -b)'{--bytes=,-b+}'['$_cut_args[bytes]']:list' \
'(--characters -c)'{--characters=,-c+}'['$_cut_args[characters]']:list' \
diff --git a/Completion/Unix/Command/_date b/Completion/Unix/Command/_date
index 59a1a9e8a..8ff685884 100644
--- a/Completion/Unix/Command/_date
+++ b/Completion/Unix/Command/_date
@@ -6,7 +6,7 @@ local -a opts args
opts=( -s -w -C )
-if _pick_variant gnu="Free Software Foundation" unix --version; then
+if _pick_variant gnu='(Free Soft|uutils)' unix --version; then
local d='(-d --date -f --file -r --reference -s --set --resolution)'
local f='(-I --iso-8601 -R --rfc-email --rfc-3339 --resolution)'
args=(
diff --git a/Completion/Unix/Command/_dd b/Completion/Unix/Command/_dd
index c55efb68c..a6c4c794b 100644
--- a/Completion/Unix/Command/_dd
+++ b/Completion/Unix/Command/_dd
@@ -4,7 +4,7 @@ local -a vals conv flags units
local variant
units=( w:word b:block k:1024 m g t )
-_pick_variant -r variant gnu=GNU $OSTYPE --version
+_pick_variant -r variant gnu='(GNU|uutils)' $OSTYPE --version
vals=(
'(ibs obs)bs[block size]: :_numbers -u bytes "block size" $units'
diff --git a/Completion/Unix/Command/_df b/Completion/Unix/Command/_df
index 315758488..dae833dfa 100644
--- a/Completion/Unix/Command/_df
+++ b/Completion/Unix/Command/_df
@@ -3,7 +3,7 @@
local curcontext="$curcontext" state state_descr line args spec ret=1
local -A opt_args
-if _pick_variant gnu=GNU unix --version; then
+if _pick_variant gnu='(GNU|uutils)' unix --version; then
args=(
'--total[produce a grand total]'
'(-T --print-type)'{-T,--print-type}'[print file system type]'
diff --git a/Completion/Unix/Command/_du b/Completion/Unix/Command/_du
index ccb5bdd94..038811eb8 100644
--- a/Completion/Unix/Command/_du
+++ b/Completion/Unix/Command/_du
@@ -1,6 +1,6 @@
#compdef du gdu
-if _pick_variant gnu=Free\ Soft unix --version /dummy/no-such-file; then
+if _pick_variant gnu='(Free Soft|uutils)' unix --version /dummy/no-such-file; then
local context state line expl ret=1
_arguments -s \
diff --git a/Completion/Unix/Command/_env b/Completion/Unix/Command/_env
index 7d86f4fd2..b9094339e 100644
--- a/Completion/Unix/Command/_env
+++ b/Completion/Unix/Command/_env
@@ -3,7 +3,7 @@
local context state line variant ign ret=1
local -a args suf
-_pick_variant -r variant gnu=Free\ Soft $OSTYPE --version
+_pick_variant -r variant gnu='(Free Soft|uutils)' $OSTYPE --version
case $variant in
gnu)
(( $#words > 2 )) && ign='!'
diff --git a/Completion/Unix/Command/_fmt b/Completion/Unix/Command/_fmt
index 59d90ff83..643160ea3 100644
--- a/Completion/Unix/Command/_fmt
+++ b/Completion/Unix/Command/_fmt
@@ -7,9 +7,9 @@ local wopt="[specify maximum line width]:width [75]"
local sopt="[don't join short lines\: split only]"
args=( -A "-*" "(1 2)-w+$wopt" '*:file:_files' )
-_pick_variant -r variant gnu=GNU $OSTYPE --version
+_pick_variant -r variant gnu='GNU' uutils=uutils $OSTYPE --version
case $variant in
- gnu)
+ uutils|gnu)
args=(
'(-c --crown-margin)'{-c,--crown-margin}$copt
'(-w --width)'{-w+,--width=}$wopt
@@ -22,6 +22,16 @@ case $variant in
'(- *)--version[display version information]'
'*:file:_files'
)
+ ;|
+ uutils)
+ args+=(
+ '(-m --preserve-headers)'{-m,--preserve-headers}'[preserve mail headers in the input]'
+ '(-P --skip-prefix)'{-P+,--skip-prefix=}'[preserve lines beginning with given prefix]:prefix'
+ '(-x --exact-prefix)'{-x,--exact-prefix}'[with -p, match at the beginning of the line with no preceding whitespace]'
+ '(-X --exact-skip-prefix)'{-X,--exact-skip-prefix}'[with -P, match at the beginning of the line with no preceding whitespace]'
+ '(-q --quick)'{-q,--quick}'[break lines more quickly at the expense of a more ragged appearance]'
+ '(-T --tab-width)'{-T,--tab-width}'[specify width to treat tabs]:width [8]'
+ )
;;
solaris*)
args=(
diff --git a/Completion/Unix/Command/_fold b/Completion/Unix/Command/_fold
index 1a3ef8b55..600e8a74b 100644
--- a/Completion/Unix/Command/_fold
+++ b/Completion/Unix/Command/_fold
@@ -3,7 +3,7 @@
local variant
local -a args
-_pick_variant -r variant busybox=BusyBox gnu='Free Soft' unix --version
+_pick_variant -r variant busybox=BusyBox gnu='(Free Soft|uutils)' unix --version
args=(
'(-b --bytes)'{-b,--bytes}'[count bytes rather than columns]'
diff --git a/Completion/Unix/Command/_head b/Completion/Unix/Command/_head
index 8877600f6..03e6485a2 100644
--- a/Completion/Unix/Command/_head
+++ b/Completion/Unix/Command/_head
@@ -3,7 +3,7 @@
local curcontext=$curcontext state state_descr line expl opts args ret=1
typeset -A opt_args
-if _pick_variant gnu=GNU unix --version; then
+if _pick_variant gnu='(GNU|uutils)' unix --version; then
args=(
'(-n --lines -c --bytes)'{-c+,--bytes=}'[print the first (or with -, all but the last) specified bytes]:number of bytes:->number'
'(-n --lines -c --bytes)'{-n+,--lines=}'[print the first (or with -, all but the last) specified lines]:number of lines:->number'
diff --git a/Completion/Unix/Command/_id b/Completion/Unix/Command/_id
index c123afcd7..64b8c9b37 100644
--- a/Completion/Unix/Command/_id
+++ b/Completion/Unix/Command/_id
@@ -2,7 +2,7 @@
local args choices
-if _pick_variant gnu=GNU $OSTYPE --version; then
+if _pick_variant gnu='(GNU|uutils)' $OSTYPE --version; then
choices='--help --version -Z --context -g --group -G --groups -u --user'
_arguments \
"($choices)"{-Z,--context}'[print only security context]' \
diff --git a/Completion/Unix/Command/_install b/Completion/Unix/Command/_install
index b7f34ea79..5f0507329 100644
--- a/Completion/Unix/Command/_install
+++ b/Completion/Unix/Command/_install
@@ -19,7 +19,7 @@ common_args=(
'*: :_files'
)
-if _pick_variant gnu='Free Soft' unix --version; then
+if _pick_variant gnu='(Free Soft|uutils)' unix --version; then
# Hide Linux-specific options on non-Linux platforms
[[ $OSTYPE == linux* ]] || lx='!'
args+=(
diff --git a/Completion/Unix/Command/_join b/Completion/Unix/Command/_join
index 4915a0600..4358415b3 100644
--- a/Completion/Unix/Command/_join
+++ b/Completion/Unix/Command/_join
@@ -12,7 +12,7 @@ args=(
'(-j -2 -j2)'{-j2,-2+}'[join on specified field of second file]:field number'
'1:file:_files' '2:file:_files'
)
-_pick_variant -r variant gnu=GNU $OSTYPE --version
+_pick_variant -r variant gnu='(GNU|uutils)' $OSTYPE --version
case $variant in
gnu)
args+=(
diff --git a/Completion/Unix/Command/_ln b/Completion/Unix/Command/_ln
index 7bd2f7f27..05c89bac2 100644
--- a/Completion/Unix/Command/_ln
+++ b/Completion/Unix/Command/_ln
@@ -9,7 +9,7 @@ args=(
'-s[create symbolic links instead of hard links]'
)
-_pick_variant -r variant -b zsh gnu=gnu $OSTYPE --help
+_pick_variant -r variant -b zsh gnu='(GNU|uutils)' $OSTYPE --version
case $variant; in
gnu)
opts=()
diff --git a/Completion/Unix/Command/_ls b/Completion/Unix/Command/_ls
index a19ad30e2..a92b91b31 100644
--- a/Completion/Unix/Command/_ls
+++ b/Completion/Unix/Command/_ls
@@ -2,7 +2,7 @@
local arguments is_gnu datef
-if ! _pick_variant gnu=gnu unix --help; then
+if ! _pick_variant gnu='(GNU|uutils)' unix --version; then
arguments=(
'(-A)-a[list entries starting with .]'
'(-a)-A[list all except . and ..]'
diff --git a/Completion/Unix/Command/_mkdir b/Completion/Unix/Command/_mkdir
index 4cd6bda32..93942a43c 100644
--- a/Completion/Unix/Command/_mkdir
+++ b/Completion/Unix/Command/_mkdir
@@ -10,7 +10,7 @@ args=(
'*: :->directories'
)
-_pick_variant -r variant -b zsh gnu=gnu $OSTYPE --help
+_pick_variant -r variant -b zsh gnu='(GNU|uutils)' $OSTYPE --version
case $variant in
gnu|freebsd*|dragonfly*|darwin*)
diff --git a/Completion/Unix/Command/_mkfifo b/Completion/Unix/Command/_mkfifo
index a055e4a1c..fcf39cfa9 100644
--- a/Completion/Unix/Command/_mkfifo
+++ b/Completion/Unix/Command/_mkfifo
@@ -2,7 +2,7 @@
local -a aopts args
-if _pick_variant gnu='Free Soft' unix --version; then
+if _pick_variant gnu='(Free Soft|uutils)' unix --version; then
args=(
'(: * -)--help[display help information]'
'(: * -)--version[display version information]'
diff --git a/Completion/Unix/Command/_mknod b/Completion/Unix/Command/_mknod
index 8f07328db..46cf08b6f 100644
--- a/Completion/Unix/Command/_mknod
+++ b/Completion/Unix/Command/_mknod
@@ -6,7 +6,7 @@
local -a aopts args
-if _pick_variant gnu='Free Soft' $OSTYPE --version; then
+if _pick_variant gnu='(Free Soft|uutils)' $OSTYPE --version; then
args=(
'(: * -)--help[display help information]'
'(: * -)--version[display version information]'
diff --git a/Completion/Unix/Command/_mktemp b/Completion/Unix/Command/_mktemp
index 0f66d744e..52c2f06ef 100644
--- a/Completion/Unix/Command/_mktemp
+++ b/Completion/Unix/Command/_mktemp
@@ -3,7 +3,7 @@
local variant
local -a args
-_pick_variant -r variant busybox=BusyBox gnu='Free Soft' $OSTYPE --version
+_pick_variant -r variant busybox=BusyBox gnu='(Free Soft|uutils)' $OSTYPE --version
args=(
'(-d --directory)'{-d,--directory}'[make directory instead of file]'
diff --git a/Completion/Unix/Command/_mv b/Completion/Unix/Command/_mv
index e9227c334..cc33819b9 100644
--- a/Completion/Unix/Command/_mv
+++ b/Completion/Unix/Command/_mv
@@ -2,7 +2,7 @@
local args variant aopts=( -A '-*' )
-_pick_variant -r variant -b zsh gnu=GNU $OSTYPE --version
+_pick_variant -r variant -b zsh gnu='(GNU|uutils)' $OSTYPE --version
case $variant; in
gnu)
aopts=()
diff --git a/Completion/Unix/Command/_nice b/Completion/Unix/Command/_nice
index b52e5216a..a54f8a9f8 100644
--- a/Completion/Unix/Command/_nice
+++ b/Completion/Unix/Command/_nice
@@ -9,7 +9,7 @@ if [[ $words[2] = -(-|+|)[0-9]## ]]; then
fi
compset -n 2 # Ignore the 1st arg
else
- if _pick_variant gnu=GNU unix --version; then
+ if _pick_variant gnu='(GNU|uutils)' unix --version; then
specs+=(
'(-)'{-n+,--adjustment=}'[adjust niceness]:niceness increment'
'(* -)--help[display help and exit]'
diff --git a/Completion/Unix/Command/_nl b/Completion/Unix/Command/_nl
index b3876dc65..2af17c491 100644
--- a/Completion/Unix/Command/_nl
+++ b/Completion/Unix/Command/_nl
@@ -16,7 +16,7 @@ args=(
'(-w --number-width)'{-w+,--number-width=}'[specify number of columns for line numbers]:columns'
)
-if _pick_variant gnu=GNU unix --version; then
+if _pick_variant gnu='(GNU|uutils)' unix --version; then
args+=(
'(- *)--help[display help information]'
'(- *)--version[display version information]'
diff --git a/Completion/Unix/Command/_od b/Completion/Unix/Command/_od
index 7673a225b..b3f693dbc 100644
--- a/Completion/Unix/Command/_od
+++ b/Completion/Unix/Command/_od
@@ -21,7 +21,7 @@ args=(
'-s[output decimal shorts (-t d2)]'
)
-if _pick_variant gnu=GNU unix --version; then
+if _pick_variant gnu='(GNU|uutils)' unix --version; then
# -h -B -I and -L are obsolescent and undocumented
args=( ${(R)args:#(|\*)(|\(*\))-[hBIL]*} )
args+=(
diff --git a/Completion/Unix/Command/_paste b/Completion/Unix/Command/_paste
index d9598bfef..9dc7b632d 100644
--- a/Completion/Unix/Command/_paste
+++ b/Completion/Unix/Command/_paste
@@ -4,7 +4,7 @@ local -a args
local dopt='[specify delimiter list]:delimiter list [tab]'
local sopt='[paste one file at a time instead of in parallel]'
-if _pick_variant gnu=GNU unix --version; then
+if _pick_variant gnu='(GNU|uutils)' unix --version; then
args=(
'(-z --zero-terminated)'{-z,--zero-terminated}'[use NUL as line delimiter instead of newline]'
"(-d)--delimiters=$dopt"
diff --git a/Completion/Unix/Command/_pr b/Completion/Unix/Command/_pr
index 2aeeb13b3..c628b5a98 100644
--- a/Completion/Unix/Command/_pr
+++ b/Completion/Unix/Command/_pr
@@ -5,7 +5,7 @@ local -a state state_descr line specs optA
typeset -A opt_args
# take care of '+FIRST_PAGE[:LAST_PAGE]' (GNU) or '+FIRST_PAGE' (POSIX)
-if _pick_variant -r variant gnu=GNU $OSTYPE --version; then
+if _pick_variant -r variant gnu='(GNU|uutils)' $OSTYPE --version; then
msg='FIRST_PAGE[:LAST_PAGE]'
else
msg='first page'
diff --git a/Completion/Unix/Command/_readlink b/Completion/Unix/Command/_readlink
index 36bd43752..16ed92947 100644
--- a/Completion/Unix/Command/_readlink
+++ b/Completion/Unix/Command/_readlink
@@ -24,7 +24,7 @@ args=(
)
# Filter out non-GNU options if applicable
-if _pick_variant gnu='Free Soft' unix --version; then
+if _pick_variant gnu='(Free Soft|uutils)' unix --version; then
aopts=( )
else
case $OSTYPE in
diff --git a/Completion/Unix/Command/_rm b/Completion/Unix/Command/_rm
index 6dddb5ece..cc2e456b5 100644
--- a/Completion/Unix/Command/_rm
+++ b/Completion/Unix/Command/_rm
@@ -8,7 +8,7 @@ args=(
'(-r -R --recursive)'{-r,-R,--recursive}'[remove directories and their contents recursively]'
'*:: :->file'
)
-_pick_variant -r variant -b zsh gnu=gnu $OSTYPE --help
+_pick_variant -r variant -b zsh gnu='(GNU|uutils)' $OSTYPE --version
case $variant; in
gnu)
opts=()
diff --git a/Completion/Unix/Command/_rmdir b/Completion/Unix/Command/_rmdir
index 501ffb1cc..029fa5b85 100644
--- a/Completion/Unix/Command/_rmdir
+++ b/Completion/Unix/Command/_rmdir
@@ -7,13 +7,15 @@ args=(
'(-p --parents)'{-p,--parents}'[remove each component of the specified paths]'
)
-_pick_variant -r variant -b zsh gnu=GNU $OSTYPE --version
+_pick_variant -r variant -b zsh gnu='(GNU|uutils)' $OSTYPE --version
case $variant; in
gnu)
aopts=()
args+=(
'--ignore-fail-on-non-empty[ignore failure if directory is non-empty]'
'(-v --verbose)'{-v,--verbose}'[be verbose]'
+ '(- *)--help[display usage information]'
+ '(- *)--version[display version information]'
)
;;
zsh)
diff --git a/Completion/Unix/Command/_seq b/Completion/Unix/Command/_seq
index 5b825675f..a0797ccc1 100644
--- a/Completion/Unix/Command/_seq
+++ b/Completion/Unix/Command/_seq
@@ -2,7 +2,7 @@
local variant args
-_pick_variant -r variant gnu=GNU $OSTYPE --version
+_pick_variant -r variant gnu='(GNU|uutils)' $OSTYPE --version
args=( ':: :_guard "^-[^0-9]*" '{first,step,last} )
case $variant in
diff --git a/Completion/Unix/Command/_sort b/Completion/Unix/Command/_sort
index a463cf4c0..90827de4f 100644
--- a/Completion/Unix/Command/_sort
+++ b/Completion/Unix/Command/_sort
@@ -19,7 +19,7 @@ args=(
\*{-k+,--key=}'[specified start and end fields for key]:key field'
)
-_pick_variant -r variant gnu=GNU $OSTYPE --version
+_pick_variant -r variant gnu='(GNU|uutils)' $OSTYPE --version
case $variant in
dragonfly*|netbsd*|openbsd*|freebsd*|darwin*|gnu)
args+=(
diff --git a/Completion/Unix/Command/_split b/Completion/Unix/Command/_split
index 5d5afa436..efca8e2f0 100644
--- a/Completion/Unix/Command/_split
+++ b/Completion/Unix/Command/_split
@@ -4,7 +4,7 @@ local curcontext="$curcontext" variant ret=1
local -A opt_args
local -a state line args
-_pick_variant -r variant gnu=GNU $OSTYPE --version
+_pick_variant -r variant gnu='(GNU|uutils)' $OSTYPE --version
args=(
'-a+[generate suffixes of specified length]:length [2]' \
diff --git a/Completion/Unix/Command/_stat b/Completion/Unix/Command/_stat
index 03abe88a3..cfd04a00a 100644
--- a/Completion/Unix/Command/_stat
+++ b/Completion/Unix/Command/_stat
@@ -10,7 +10,7 @@ local expl variant ret=1
local -a context line state state_descr args aopts=( -A '-*' )
local -A opt_args
-_pick_variant -r variant -b zsh gnu='Free Soft' $OSTYPE --version
+_pick_variant -r variant -b zsh gnu='(Free Soft|uutils)' $OSTYPE --version
case $variant in
zsh)
diff --git a/Completion/Unix/Command/_stdbuf b/Completion/Unix/Command/_stdbuf
index 32b3cae2f..71dd98e0a 100644
--- a/Completion/Unix/Command/_stdbuf
+++ b/Completion/Unix/Command/_stdbuf
@@ -10,7 +10,7 @@ buf=( err in out )
opt='[set initial buffering for std${buf[i]}]: : _alternative
"sizes\: \: _numbers -u bytes size k M G"
"modes\:mode\:((0\:unbuffered L\:line\ buffered'
-if _pick_variant gnu=GNU freebsd --version; then
+if _pick_variant gnu='(GNU|uutils)' freebsd --version; then
gnu=1
args=(
'(- *)--help[display usage information]'
diff --git a/Completion/Unix/Command/_tac b/Completion/Unix/Command/_tac
index 083fce91f..223966ff7 100644
--- a/Completion/Unix/Command/_tac
+++ b/Completion/Unix/Command/_tac
@@ -1,7 +1,7 @@
#compdef tac gtac
# NetBSD (at least) has its own bare-bones version of this tool
-_pick_variant gnu='Free Soft' unix --version || {
+_pick_variant gnu='(Free Soft|uutils)' unix --version || {
_default
return
}
diff --git a/Completion/Unix/Command/_tail b/Completion/Unix/Command/_tail
index f8006abbc..c55dd6be6 100644
--- a/Completion/Unix/Command/_tail
+++ b/Completion/Unix/Command/_tail
@@ -3,7 +3,7 @@
local curcontext=$curcontext state state_descr line opts args ret=1
typeset -A opt_args
-if _pick_variant gnu=GNU unix --version; then
+if _pick_variant gnu='(GNU|uutils)' unix --version; then
args=(
'(-n --lines -c --bytes)'{-c+,--bytes=}'[print the last specified bytes; with +, start at the specified byte]:number of bytes:->number'
'(-n --lines -c --bytes)'{-n+,--lines=}'[print the last specified lines; with +, start at the specified line]:number of lines:->number'
diff --git a/Completion/Unix/Command/_tee b/Completion/Unix/Command/_tee
index 66ef66e19..6c9378ed1 100644
--- a/Completion/Unix/Command/_tee
+++ b/Completion/Unix/Command/_tee
@@ -14,7 +14,7 @@ args=(
)
# Filter out non-GNU options if applicable
-_pick_variant gnu='Free Soft' unix --version ||
+_pick_variant gnu='(Free Soft|uutils)' unix --version ||
args=( ${(@M)args:#(|*\))-[ai]\[*} )
_arguments -s -S : $args '*: :_files' && ret=0
diff --git a/Completion/Unix/Command/_touch b/Completion/Unix/Command/_touch
index 47190c579..b14900d66 100644
--- a/Completion/Unix/Command/_touch
+++ b/Completion/Unix/Command/_touch
@@ -1,7 +1,7 @@
#compdef touch gtouch
local args variant
-_pick_variant -r variant gnu=GNU $OSTYPE --version
+_pick_variant -r variant gnu='(GNU|uutils)' $OSTYPE --version
args=(
'-a[change access time (atime)]'
diff --git a/Completion/Unix/Command/_tr b/Completion/Unix/Command/_tr
index 6d899431c..46e99e635 100644
--- a/Completion/Unix/Command/_tr
+++ b/Completion/Unix/Command/_tr
@@ -9,7 +9,7 @@ descr=(
-s '[squeeze repeated instances of character to a single instance]'
)
-_pick_variant -r variant gnu=GNU $OSTYPE --version
+_pick_variant -r variant gnu='(GNU|uutils)' $OSTYPE --version
case $variant in
gnu)
args=(
diff --git a/Completion/Unix/Command/_truncate b/Completion/Unix/Command/_truncate
index 117be9702..dc0235d04 100644
--- a/Completion/Unix/Command/_truncate
+++ b/Completion/Unix/Command/_truncate
@@ -4,7 +4,7 @@ local curcontext=$curcontext variant rs ret=1
local -a state state_descr line specs optA
typeset -A opt_args
-_pick_variant -r variant gnu=GNU $OSTYPE --version
+_pick_variant -r variant gnu='(GNU|uutils)' $OSTYPE --version
[[ $variant != gnu ]] && rs='-r -s' # -r/-s mutually exclusive
# common specs
diff --git a/Completion/Unix/Command/_tty b/Completion/Unix/Command/_tty
index 838975098..d100751ce 100644
--- a/Completion/Unix/Command/_tty
+++ b/Completion/Unix/Command/_tty
@@ -2,7 +2,7 @@
local -a args
-if _pick_variant gnu='Free Soft' unix --version; then
+if _pick_variant gnu='(Free Soft|uutils)' unix --version; then
args=(
'(-)--help[display help information]'
'(-)--version[display version information]'
diff --git a/Completion/Unix/Command/_uname b/Completion/Unix/Command/_uname
index c58f2edfd..ffdc8080a 100644
--- a/Completion/Unix/Command/_uname
+++ b/Completion/Unix/Command/_uname
@@ -38,7 +38,7 @@ case $LANG in
;;
esac
-if _pick_variant gnu="Free Soft" unix --version; then
+if _pick_variant gnu='(Free Soft|uutils)' unix --version; then
_arguments -s \
'(-)'{--all,-a}'['$_uname_args[all]']' \
'(--kernel-name -s)'{--kernel-name,-s}'['$_uname_args[kernel-name]']' \
diff --git a/Completion/Unix/Command/_unexpand b/Completion/Unix/Command/_unexpand
index b548b3c3a..28ea5b74f 100644
--- a/Completion/Unix/Command/_unexpand
+++ b/Completion/Unix/Command/_unexpand
@@ -6,7 +6,7 @@ local -a args
all="convert all whitespace, instead of just initial whitespace"
tabs="[use comma separated list of tab positions]:list of tab positions"
-if _pick_variant gnu="Free Soft" unix --version; then
+if _pick_variant gnu='(Free Soft|uutils)' unix --version; then
if [[ $service = *un* ]]; then
args=(
"(-a --help --version)--all[$all]"
diff --git a/Completion/Unix/Command/_uniq b/Completion/Unix/Command/_uniq
index efd556de8..fb82f6d9f 100644
--- a/Completion/Unix/Command/_uniq
+++ b/Completion/Unix/Command/_uniq
@@ -18,7 +18,7 @@ args=(
'(- *)--version[display version information]'
)
-if ! _pick_variant gnu=Free\ Soft unix --version; then
+if ! _pick_variant gnu='(Free Soft|uutils)' unix --version; then
local optchars="cdufs"
if [[ "$OSTYPE" == (darwin|dragonfly|freebsd|openbsd)* ]]; then
optchars+=i
diff --git a/Completion/Unix/Command/_wc b/Completion/Unix/Command/_wc
index 2a4f7ab05..6bac8699f 100644
--- a/Completion/Unix/Command/_wc
+++ b/Completion/Unix/Command/_wc
@@ -9,7 +9,7 @@ args=(
'(-l --lines)'{-l,--lines}'[print line counts]'
)
-if _pick_variant gnu=GNU unix --version; then
+if _pick_variant gnu='(GNU|uutils)' unix --version; then
args+=(
'(*)--files0-from=[read NUL-terminated file list from specified file]:file:_files'
'(-L --max-line-length)'{-L,--max-line-length}'[print longest line lengths]'
diff --git a/Completion/Unix/Command/_who b/Completion/Unix/Command/_who
index 1f901af18..548736fbc 100644
--- a/Completion/Unix/Command/_who
+++ b/Completion/Unix/Command/_who
@@ -2,7 +2,7 @@
local args variant
-_pick_variant -r variant gnu=GNU $OSTYPE --version
+_pick_variant -r variant gnu='(GNU|uutils)' $OSTYPE --version
case $variant in
gnu)