Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] completion: add _uids, _gids



On Fri 10 Jul 2026, at 01:18, Oliver Kiddle wrote:
> single function can handle that better.

how about this

- _users and _groups can complete either or both of names + ids

- _uids and _gids are thin wrappers for _users/_groups -u

- as we discussed on irc, the listing was confusing when both types
  were completed because they looked the same but inserted different
  things. to help with this, i made it use the id as the match
  description with -u

- however it's annoying to have each of these entries take up a whole
  line. _numbers builds the display strings itself to avoid this issue.
  rather than copy+paste that method twice here, i added an option -c
  (as in print -c) to _describe to make it not use compadd -l. i'll add
  tests and update _numbers to use this if you approve

- i made it filter the ids to those matching the names in the
  users/groups styles. i realise these names may not actually exist but
  that felt better than doing nothing, and idk if there's a use case for
  fake ids

- i removed lookupd, it's been gone for 17 years. and i standardised on
  dscl over dscacheutil. i'm not sure if the latter can be faster but
  they're about the same for me at least, and the output is easier to
  deal with. i'll revisit if anyone complains

- i added nis support to the no-getent case in _users, to match _groups.
  but i'd be inclined to remove it from both of them tbh. i imagine it's
  not used much any more

- i removed the cache from _groups. i assume that was for nis and
  probably isn't that necessary now

dana


diff --git a/Completion/Base/Utility/_describe b/Completion/Base/Utility/_describe
index c12eb0eab..1ac90a816 100644
--- a/Completion/Base/Utility/_describe
+++ b/Completion/Base/Utility/_describe
@@ -9,7 +9,7 @@
 
 # This can be used to add options or values with descriptions as matches.
 
-local _opt _expl _tmpm _tmpd _mlen _noprefix
+local _opt _expl _tmpm _tmpd _mlen _noprefix _cols
 local _type=values _descr _ret=1 _showd _nm _hide _args _grp _sep
 local csl="$compstate[list]" csl2
 local _oargv _argv _new _strs _mats _opts _i _try=0
@@ -18,8 +18,11 @@ local -a _jvx12
 
 # Get the option.
 
-while getopts "oOt:12JVx" _opt; do
+while getopts "coOt:12JVx" _opt; do
   case $_opt in
+    (c)
+      _cols=1
+      ;;
     (o)
       _type=options;;
     (O)
@@ -131,6 +134,10 @@ while _tags; do
       compstate[list]="$csl $csl2"
       [[ -n "$csl2" ]] && compstate[list]="${compstate[list]:s/rows//}"
 
+      # this assumes -l will always be the first option when used, which is
+      # currently the case
+      (( _cols )) && [[ $_args[1] == -l ]] && shift _args
+
       compadd "$_args[@]" -d _tmpd -a _tmpm && _ret=0
     done
   done
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index 4ced8e4a6..d351fb885 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -4410,7 +4410,7 @@ commonly useful things like filenames.
 )
 findex(_describe)
 redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ @ @ @ @ @ @ ))ifnztexi(          )))
-xitem(tt(_describe )[tt(-12JVx)] [ tt(-oO) | tt(-t) var(tag) ] var(descr) var(name1) [ var(name2) ] [ var(opt) ... ])
+xitem(tt(_describe )[tt(-12cJVx)] [ tt(-oO) | tt(-t) var(tag) ] var(descr) var(name1) [ var(name2) ] [ var(opt) ... ])
 item(SPACES()[ tt(-)tt(-) var(name1) [ var(name2) ] [ var(opt) ... ] ... ])(
 This function associates completions with descriptions.
 Multiple groups separated by tt(-)tt(-) can be supplied, potentially with
@@ -4445,6 +4445,9 @@ descriptions are shown.  If `tt(-O)' is used instead of `tt(-o)', command
 options are completed as above but tt(_describe) will not handle the
 tt(prefix-needed) style.
 
+By default, completions with descriptions are listed one per line.  With
+tt(-c), they are printed in columns if possible.
+
 With the tt(-t) option a var(tag) can be specified.  The default is
 `tt(values)' or, if the tt(-o) option is given, `tt(options)'.
 


diff --git a/Completion/Unix/Type/_gids b/Completion/Unix/Type/_gids
new file mode 100644
index 000000000..ffb327fc1
--- /dev/null
+++ b/Completion/Unix/Type/_gids
@@ -0,0 +1,3 @@
+#autoload
+
+_groups -u "$@"
diff --git a/Completion/Unix/Type/_groups b/Completion/Unix/Type/_groups
index c5e5aaf83..2f3c2266f 100644
--- a/Completion/Unix/Type/_groups
+++ b/Completion/Unix/Type/_groups
@@ -1,28 +1,58 @@
 #compdef newgrp groupdel
 
-local expl groups tmp
-
-_tags groups || return 1
-
-if ! zstyle -a ":completion:${curcontext}:" groups groups; then
-  (( $+_cache_groups )) ||
-      if [[ $OSTYPE = darwin* ]]; then
-        if (( ${+commands[lookupd]} )); then 
-          : ${(A)_cache_groups:=${${(M)${(f)"$(_call_program groups lookupd -q group)"}:#name*}##*: }}
-        elif (( ${+commands[dscacheutil]} )); then
-          : ${(A)_cache_groups:=${${(M)${(f)"$(_call_program groups dscacheutil -q group)"}:#name*}##*: }}
-        fi
-      elif (( ${+commands[getent]} )); then
-        : ${(A)_cache_groups:=${${(f)"$(_call_program groups getent group 2>/dev/null)"}%%:*}}
-      else
-        : ${(A)_cache_groups:=${${${(f)"$(</etc/group)"}%%:*}:#+}}
-	if (( ${+commands[ypcat]} )) &&
-	    tmp=$(_call_program groups ypcat group.byname 2>/dev/null); then
-          _cache_groups+=( ${${(f)tmp}%%:*} ) # If you use YP
-	fi
-      fi
-
-  groups=( "$_cache_groups[@]" )
+# complete group names and/or ids. see also _users
+# -N  complete names (default if not specified)
+# -u  complete ids
+
+local ret=1
+local -a match mbegin mend s_ca_opts ca_opts expl groups ugroups
+local -A opth
+
+zparseopts -A opth -D -F - \
+  {1,2,J+:,V+:,x+:,X+:}=s_ca_opts \
+  {M+:,o+:,O+:,P+:,q+,r+:,R+:,S+:}=ca_opts \
+  N u \
+|| return
+
+(( $+opth[-N] + $+opth[-u] )) || opth[-N]=
+(( $+opth[-N] + $+opth[-u] == 2 )) || ca_opts+=( "${(@)s_ca_opts}" )
+
+zstyle -a ":completion:${curcontext}:groups" groups ugroups
+
+(( $+opth[-u] || ! $+ugroups[1] )) && {
+  [[ $OSTYPE == darwin* ]] && groups=( ${${(f)"$(
+    _call_program dscl dscl . -list /Groups PrimaryGroupID
+  )"}/%(#b)(*[^[:space:]])[[:space:]]##(-#<->)/$match[1]:$match[2]} )
+
+  (( $+groups[1] )) || {
+    if (( $+commands[getent] )); then
+      groups=( ${(f)"$( _call_program getent getent group )"} )
+    else
+      groups=( ${(f)"$( _call_program cat cat group )"} )
+      (( $+commands[ypcat] )) &&
+      groups+=( ${(f)"$( _call_program ypcat ypcat group.byname )"} )
+    fi
+    groups=( ${groups:#[[:space:]]#\#*} )
+    groups=( ${groups/#(#b)([^:]##):[^:]##:([^:]##):*/$match[1]:$match[2]} )
+  }
+}
+
+(( $+opth[-N] )) &&
+if (( $+ugroups[1] )); then
+  _wanted groups expl group compadd "${(@)ca_opts}" -a - ugroups && ret=0
+else
+  _wanted groups expl group compadd "${(@)ca_opts}" - ${groups%:*} && ret=0
 fi
 
-_wanted groups expl group compadd -a "$@" - groups
+(( $+opth[-u] )) && {
+  local -a disp inst
+
+  (( $+ugroups[1] )) && groups=( ${(M)groups:#(${(~j<|>)ugroups}):*} )
+
+  disp=( $groups )
+  inst=( ${groups##*:} )
+
+  _describe -ct group-ids 'group ID' disp inst "${(@)ca_opts}" && ret=0
+}
+
+return ret
diff --git a/Completion/Unix/Type/_uids b/Completion/Unix/Type/_uids
new file mode 100644
index 000000000..354f71510
--- /dev/null
+++ b/Completion/Unix/Type/_uids
@@ -0,0 +1,3 @@
+#autoload
+
+_users -u "$@"
diff --git a/Completion/Unix/Type/_users b/Completion/Unix/Type/_users
index 2ea3b1455..00de05aee 100644
--- a/Completion/Unix/Type/_users
+++ b/Completion/Unix/Type/_users
@@ -1,10 +1,59 @@
 #compdef passwd groups userdel chage chfn
 
-local expl users
+# complete user names and/or ids
+# -N  complete names (default if not specified)
+# -u  complete ids
 
-if zstyle -a ":completion:${curcontext}:users" users users; then
-  _wanted users expl user compadd "$@" -a - users
-  return
+local ret=1
+local -a s_ca_opts ca_opts expl users uusers
+local -A opth
+
+zparseopts -A opth -D -F - \
+  {1,2,J+:,V+:,x+:,X+:}=s_ca_opts \
+  {M+:,o+:,O+:,P+:,q+,r+:,R+:,S+:}=ca_opts \
+  N u \
+|| return
+
+(( $+opth[-N] + $+opth[-u] )) || opth[-N]=
+# these options only make sense with one type
+(( $+opth[-N] + $+opth[-u] == 2 )) || ca_opts+=( "${(@)s_ca_opts}" )
+
+zstyle -a ":completion:${curcontext}:users" users uusers
+
+(( $+opth[-N] )) &&
+if (( $+uusers[1] )); then
+  _wanted users expl user compadd "${(@)ca_opts}" -a - uusers && ret=0
+else
+  _wanted users expl user compadd "${(@)ca_opts}" -k - userdirs && ret=0
 fi
 
-_wanted users expl user compadd "$@" -k - userdirs
+(( $+opth[-u] )) && {
+  local -a match mbegin mend users disp inst
+
+  # open directory is the primary source on macos
+  [[ $OSTYPE == darwin* ]] && users=( ${${(f)"$(
+    _call_program dscl dscl . -list /Users UniqueID
+  )"}/%(#b)(*[^[:space:]])[[:space:]]##(-#<->)/$match[1]:$match[2]} )
+
+  (( $+users[1] )) || {
+    if (( $+commands[getent] )); then
+      users=( ${(f)"$( _call_program getent getent passwd )"} )
+    else
+      users=( ${(f)"$( _call_program cat cat passwd )"} )
+      (( $+commands[ypcat] )) &&
+      users+=( ${(f)"$( _call_program ypcat ypcat passwd.byname )"} )
+    fi
+    # most systems allow comments in this file
+    users=( ${users:#[[:space:]]#\#*} )
+    users=( ${users/#(#b)([^:]##):[^:]##:([^:]##):*/$match[1]:$match[2]} )
+  }
+
+  (( $+uusers[1] )) && users=( ${(M)users:#(${(~j<|>)uusers}):*} )
+
+  disp=( $users )
+  inst=( ${users##*:} )
+
+  _describe -ct user-ids 'user ID' disp inst "${(@)ca_opts}"
+}
+
+return ret


diff --git a/Completion/Darwin/Command/_hdiutil b/Completion/Darwin/Command/_hdiutil
index 20e69cbc5..2f2133d03 100644
--- a/Completion/Darwin/Command/_hdiutil
+++ b/Completion/Darwin/Command/_hdiutil
@@ -247,8 +247,8 @@ _hdiutil(){
           Case-sensitive\ APFS\:'APFS (case-sensitive)'
         ))" \
         "-volname[volume name]:name" \
-        "-uid[uid of root directory]:uid in number" \
-        "-gid[gid of root directory]:gid in number" \
+        "-uid[uid of root directory]: :_uids" \
+        "-gid[gid of root directory]: :_gids" \
         "-mode[mode of root directory]:mode" \
         "-nouuid[suppress adding a UUID]" \
         "(-noautostretch)-autostretch" \
diff --git a/Completion/Linux/Command/_ionice b/Completion/Linux/Command/_ionice
index 9989cd6a9..0b21ce14d 100644
--- a/Completion/Linux/Command/_ionice
+++ b/Completion/Linux/Command/_ionice
@@ -16,9 +16,9 @@ _arguments -C -s -S \
   '(- *)'{-V,--version}'[display version information]' \
   '(- *)'{-h,--help}'[display help information]' \
   + '(args)' \
-  '(H)'{-p-,--pid=-}'[interpret args as process ID]::process id:_pids' \
-  '(H)'{-P-,--pgid=-}'[specify process group IDs]::process group:_pgids' \
-  '(H)'{-u-,--uid=-}'[act on running process owned by specified users]::user id' && ret=0
+  '(H)'{-p-,--pid=-}'[interpret args as process ID]:: :_pids' \
+  '(H)'{-P-,--pgid=-}'[specify process group IDs]:: :_pgids' \
+  '(H)'{-u-,--uid=-}'[act on running process owned by specified users]:: :_uids' && ret=0
 
 if [[ -n $state ]]; then
   if (( $+opt_args[args--p] || $+opt_args[args---pid] )); then
@@ -26,7 +26,7 @@ if [[ -n $state ]]; then
   elif (( $+opt_args[args--P] || $+opt_args[args---pgid] )); then
     _pgids && ret=0
   elif (( $+opt_args[args--u] || $+opt_args[args---uid] )); then
-    _message -e uids 'user id'
+    _uids && ret=0
   else
     _normal -p $service && ret=0
   fi
diff --git a/Completion/Linux/Command/_iptables b/Completion/Linux/Command/_iptables
index 2ac13b481..a9bdfc4e0 100644
--- a/Completion/Linux/Command/_iptables
+++ b/Completion/Linux/Command/_iptables
@@ -240,10 +240,10 @@ while
     osf) args+=( --genre:string --{ttl,log}:level ) ;;
     owner)
       args+=(
-        '--uid-owner[match packet by user id of creating process]:user id'
-	'--gid-owner[match packet by ggroup id of creating process]:group id'
-	'--pid-owner[match packet by process id of creating process]:process id:_pids'
-	'--sid-owner[match packet by session id of creating process]:session id'
+        '--uid-owner[match packet by user id of creating process]: :_uids'
+        '--gid-owner[match packet by group id of creating process]: :_gids'
+        '--pid-owner[match packet by process id of creating process]: :_pids'
+        '--sid-owner[match packet by session id of creating process]:session id'
         --suppl-groups --socket-exists
       )
     ;;
diff --git a/Completion/Linux/Command/_nsenter b/Completion/Linux/Command/_nsenter
index 8e7c6bc42..9299efa7c 100644
--- a/Completion/Linux/Command/_nsenter
+++ b/Completion/Linux/Command/_nsenter
@@ -14,8 +14,8 @@ _arguments -S -s \
   '(-C --cgroup)'{-C-,--cgroup=-}'[enter cgroup namespace]::file:_files' \
   '(-U --user)'{-U-,--user=-}'[enter user namespace]::file:_files' \
   '(-T --time)'{-T-,--time=-}'[enter time namespace]::file:_files' \
-  '(-S --setuid)'{-S+,--setuid=}'[set uid in entered namespace]:uid [0]' \
-  '(-G --setgid)'{-G+,--setgid=}'[set gid in entered namespace]:gid [0]' \
+  '(-S --setuid)'{-S+,--setuid=}'[set uid in entered namespace]:user ID [0]:_uids' \
+  '(-G --setgid)'{-G+,--setgid=}'[set gid in entered namespace]:group ID [0]:_gids' \
   "--preserve-credentials[don't touch uids or gids]" \
   '(-r --root)'{-r+,--root=}'[set the root directory]:directory:_directories' \
   '(-w --wd)'{-w+,--wd=}'[set the working directory]:directory:_directories' \
@@ -25,4 +25,3 @@ _arguments -S -s \
   "${ign}(- 1 *)"{-V,--version}'[display version information]' \
   '1: : _command_names -e' \
   '*::args :_normal'
-
diff --git a/Completion/Linux/Command/_unshare b/Completion/Linux/Command/_unshare
index ff6f7042f..b0be378b5 100644
--- a/Completion/Linux/Command/_unshare
+++ b/Completion/Linux/Command/_unshare
@@ -30,8 +30,8 @@ _arguments -S -s \
   '--keep-caps[retain capabilities granted in user namespaces]' \
   '(-R --root)'{-R+,--root=}'[set the root directory]:directory:_directories' \
   '(-w --wd)'{-w+,--wd=}'[set the working directory]:directory:_directories' \
-  '(-S --setuid)'{-S+,--setuid=}'[set uid in entered namespace]:uid [0]' \
-  '(-G --setgid)'{-G+,--setgid=}'[set gid in entered namespace]:gid [0]' \
+  '(-S --setuid)'{-S+,--setuid=}'[set uid in entered namespace]:user ID [0]:_uids' \
+  '(-G --setgid)'{-G+,--setgid=}'[set gid in entered namespace]:group ID [0]:_gids' \
   '--monotonic=[set clock monotonic offset in time namespaces]:offset (seconds)' \
   '--boottime=[set clock boottime offset in time namespaces]:offset (seconds)' \
   "${ign}(- 1 *)"{-h,--help}'[display usage information]' \
diff --git a/Completion/Linux/Type/_fuse_values b/Completion/Linux/Type/_fuse_values
index 211eb5b35..f772b85f0 100644
--- a/Completion/Linux/Type/_fuse_values
+++ b/Completion/Linux/Type/_fuse_values
@@ -37,11 +37,12 @@ fvals=(
   'direct_io[use direct I/O]'
   'kernel_cache[cache files in kernel]'
   'umask[set file permissions]:permission mask (octal)'
-  'uid[set file owner]:user id:'
-  'gid[set file group]:group id:'
-  'entry_timeout[cache timeout for names]:timeout (s)'
-  'negative_timeout[cache timeout for deleted names]:timeout (s)'
-  'attr_timeout[cache timeout for attributes]:timeout (s)'
+  'uid[set file owner]: :_uids'
+  'gid[set file group]: :_gids'
+  'entry_timeout[cache timeout for names]: :_numbers -fu seconds -l0 -d1 timeout'
+  'negative_timeout[cache timeout for deleted names]: :_numbers -fu seconds -l0 -d0 timeout'
+  'attr_timeout[cache timeout for attributes]: :_numbers -fu seconds -l0 -d1 timeout'
+  'ac_attr_timeout[auto_cache timeout for attributes]: :_numbers -fu seconds -l0 timeout'
 )
 
 [[ -n $cvalsvar ]] && set -- "$@" ${(P)cvalsvar}
diff --git a/Completion/Solaris/Command/_prstat b/Completion/Solaris/Command/_prstat
index a95919127..a52250ec3 100644
--- a/Completion/Solaris/Command/_prstat
+++ b/Completion/Solaris/Command/_prstat
@@ -27,15 +27,15 @@ _arguments -A "-*" \
   '-L[statistics for each light-weight process (LWP)]' \
   '-m[microstate process accounting information]' \
   '-n[restrict number of output lines]:ntop,[nbottom]' \
-  '-p[only processes whose process ID is in the list]:PID list' \
+  '-p[only processes whose process ID is in the list]: :_sequence _pids' \
   '-P[only processes or lwps which have most recently executed on a CPU in the list]:CPU list' \
   '-R[put prstat in the real time scheduling class]' \
   '-s[sort key (descending)]:sort key [cpu]:(($sort_key))' \
   '-S[sort key (ascending)]:sort key [cpu]:(($sort_key))' \
   '-t[total usage summary for each user]' \
   '-T[information about processes and tasks]' \
-  '-u[only processes whose effective user ID is in the list]:UID:_users' \
-  '-U[only processes whose real user ID is in the list]:UID:_users' \
+  '-u[only processes whose effective user ID is in the list]: :_sequence _users' \
+  '-U[only processes whose real user ID is in the list]: :_sequence _users' \
   '-v[verbose process usage]' \
   '-z[only processes or LWPs whose zone ID is in the list]:zone ID' \
   '-Z[information about processes and zones]'
diff --git a/Completion/Unix/Command/_find b/Completion/Unix/Command/_find
index 2afb46e34..44d684c63 100644
--- a/Completion/Unix/Command/_find
+++ b/Completion/Unix/Command/_find
@@ -64,8 +64,8 @@ case $variant in
   freebsd*|dragonfly*|darwin*|gnu)
     args+=(
       '*-delete'
-      '*-gid:numeric group ID'
-      '*-uid:numeric user ID'
+      '*-gid: :_gids'
+      '*-uid: :_uids'
       '*-noleaf'
       '*-lname:link pattern to search'
       '*-ilname:link pattern to search (case insensitive)'
diff --git a/Completion/Unix/Command/_genisoimage b/Completion/Unix/Command/_genisoimage
index e0a5f2ab8..5de30235d 100644
--- a/Completion/Unix/Command/_genisoimage
+++ b/Completion/Unix/Command/_genisoimage
@@ -26,7 +26,8 @@ _arguments \
   '(-D -disable-deep-relocation)'{-D,-disable-deep-relocation}'[disable deep directory relocation]' \
   '-file-mode:mode:' \
   '(-f -follow-links)'{-f,-follow-links}'[follow symbolic links]' \
-  '-gid:gid:' \
+  '-gid[override GID from source files to specified GID]: :_gids' \
+  '-uid[override UID from source files to specified UID]: :_uids' \
   '-graft-points[allow to use graft points for filenames]' \
   '-root:dir:_files -/' \
   '-old-root:dir:_files -/' \
diff --git a/Completion/Unix/Command/_links b/Completion/Unix/Command/_links
index 495937709..0dddff7f6 100644
--- a/Completion/Unix/Command/_links
+++ b/Completion/Unix/Command/_links
@@ -129,12 +129,12 @@ case $state in
   ;;
   sproxies)
     if ! compset -P '*@'; then
-      _message -e users 'user id'
+      _users -r@ -S@
       return
     fi
   ;&
   proxies)
-    local suf=-S:
+    local -a suf=( -r: -S: )
     if compset -P '*:'; then
       _message -e ports 'port number'
     else
diff --git a/Completion/Unix/Command/_mount b/Completion/Unix/Command/_mount
index bdabd3791..61c65037f 100644
--- a/Completion/Unix/Command/_mount
+++ b/Completion/Unix/Command/_mount
@@ -339,16 +339,16 @@ if (( ! $+_fs_any )); then
       'rootcontext:context:_selinux_contexts -a file_type'
     )
     _fs_adfs=(
-      'uid[set owner of root]:user ID'
-      'gid[set group of root]:group ID'
+      'uid[set owner of root]: :_uids'
+      'gid[set group of root]: :_gids'
       'ownmask[permission mask for ADFS "owner" permissions]:mask (octal)'
       'othmask[permission mask for ADFS "other" permissions]:mask (octal)'
     )
     _fs_affs=(
-      'uid[set owner of root]:user ID'
-      'gid[set group of root]:group ID'
-      'setuid[set owner of all files]:user ID'
-      'setgid[set group of all files]:group ID'
+      'uid[set owner of root]: :_uids'
+      'gid[set group of root]: :_gids'
+      'setuid[set owner of all files]: :_uids'
+      'setgid[set group of all files]: :_gids'
       'mode[set file permissions]:file permission bits'
       "protect[don't allow changes to permissions]"
       'usemp[set owner of root to owner of mount point]'
@@ -360,8 +360,8 @@ if (( ! $+_fs_any )); then
       'bs[specify block size]:block size:(512 1024 2048 4192)'
     )
     _fs_devpts=(
-      "uid[set owner of newly created pty's]:user ID"
-      "gid[set group of newly created pty's]:group ID"
+      "uid[set owner of newly created pty's]: :_uids"
+      "gid[set group of newly created pty's]: :_gids"
       "mode[set mode of newly created pty's]:file permission bits"
     )
     _fs_ext2=(
@@ -380,16 +380,16 @@ if (( ! $+_fs_any )); then
       'nouid32[disable 32-bit UIDs and GIDs]'
       '(orlov)oldalloc[use old allocator for new inodes]'
       '(oldalloc)orlov[use orlov allocator for new inodes]'
-      'resgid[specify access to reserved space (group ID)]:group ID'
-      'resuid[specify access to reserved space (user ID)]:user ID'
+      'resgid[specify access to reserved space (group ID)]: :_gids'
+      'resuid[specify access to reserved space (user ID)]: :_uids'
       'sb[specify super block number]:super block number'
       '(nouser_xattr)user_xattr[support user extended attributes]'
       '(user_xattr)nouser_xattr[do not support user extended attributes]'
     )
     _fs_fat=(
       'blocksize[specify block size]:block size:(512 1024 2048)'
-      'uid[specify user ID of all files]:user ID'
-      'gid[specify group ID of all files]:group ID'
+      'uid[specify user ID of all files]: :_uids'
+      'gid[specify group ID of all files]: :_gids'
       'umask[specify umask]:umask value (octal)'
       'dmask[specify umask for directories only]:umask value (octal)'
       'fmask[specify umask for files only]:umask value (octal)'
@@ -443,8 +443,8 @@ if (( ! $+_fs_any )); then
       'quiet[do not complain about invalid mount options]'
     )
     _fs_hpfs=(
-      'uid[specify user ID of all files]:user ID'
-      'gid[specify group ID of all files]:group ID'
+      'uid[specify user ID of all files]: :_uids'
+      'gid[specify group ID of all files]: :_gids'
       'umask[specify umask]:umask value (octal)'
       'case[specify file name conversion]:file name conversion:((lower\:convert\ to\ lower\ case asis\:no\ conversion))'
       'conv[specify CR elimination]:CR elimination:((binary\:no\ elimination test\:delete\ CRs\ \(e.g.\ before\ NL\) auto\:sometimes\ yes,\ sometimes\ not))'
@@ -478,8 +478,8 @@ if (( ! $+_fs_any )); then
       '(uni_xlate)utf8[use UTF-8 for converting file names]'
       '(utf8)uni_xlate[translate unicode to escaped sequences]:type:(0 1 2)'
       'posix[distinguish upper and lower case]:state:((0\:off 1\:on))'
-      'uid[specify user ID of all files]:user ID'
-      'gid[specify group ID of all files]:group ID'
+      'uid[specify user ID of all files]: :_uids'
+      'gid[specify group ID of all files]: :_gids'
       'umask[specify umask]:umask value (octal)'
     )
     _fs_reiserfs=(
@@ -501,8 +501,8 @@ if (( ! $+_fs_any )); then
       'nr_inodes[set number of inodes]:inodes'
     )
     _fs_udf=(
-      'uid[specify user ID of all files]:user ID'
-      'gid[specify group ID of all files]:group ID'
+      'uid[specify user ID of all files]: :_uids'
+      'gid[specify group ID of all files]: :_gids'
       'umask[specify umask]:umask value (octal)'
       'unhide[show hidden and associated files]'
       'undelete[show deleted files]'
@@ -518,14 +518,14 @@ if (( ! $+_fs_any )); then
       'onerror[set behaviour on error]:behaviour on error:(panic lock umount repair)'
     )
     _fs_usbfs=(
-      'devuid[set owner of device files]:user ID'
-      'devgid[set group of device files]:group ID'
+      'devuid[set owner of device files]: :_uids'
+      'devgid[set group of device files]: :_gids'
       'devmode[set mode of device files]:file permission bits'
-      'busuid[set owner of bus directories]:user ID'
-      'busgid[set group of bus directories]:group ID'
+      'busuid[set owner of bus directories]: :_uids'
+      'busgid[set group of bus directories]: :_gids'
       'busmode[set mode of bus directories]:file permission bits'
-      'listuid[set owner of file devices]:user ID'
-      'listgid[set group of file devices]:group ID'
+      'listuid[set owner of file devices]: :_uids'
+      'listgid[set group of file devices]: :_gids'
       'listmode[set mode of file devices]:file permission bits'
     )
     _fs_xfs=(
diff --git a/Completion/Unix/Command/_user_admin b/Completion/Unix/Command/_user_admin
index d5a53af7c..f5a205168 100644
--- a/Completion/Unix/Command/_user_admin
+++ b/Completion/Unix/Command/_user_admin
@@ -19,7 +19,7 @@ case ${service%???}:${(M)service%???}:$OSTYPE in
       '(-D -g --gid)'{-g+,--gid=}'[specify primary group]:initial group:_groups'
       '(-D -G --groups)'{-G+,--groups=}'[specify supplementary groups]:supplementary group:_sequence _groups'
       '(-D -s --shell)'{-s+,--shell=}"[shell]:shell:( $shells /bin/false )"
-      '(-D -u --uid)'{-u+,--uid=}'[specify uid]:uid'
+      '(-D -u --uid)'{-u+,--uid=}'[specify uid]:user ID (must be unique without -o):_uids'
       '(-D -o --non-unique)'{-o,--non-unique}'[allow non unique uid]'
     )
   ;|
@@ -135,7 +135,7 @@ case ${service%???}:${(M)service%???}:$OSTYPE in
   ;|
   group:*)
     args+=(
-      '(-g --gid)'{-g+,--gid=}'[specify gid]:gid'
+      '(-g --gid)'{-g+,--gid=}'[specify gid]:group ID (must be unique without -o):_gids'
       '(-o --non-unique)'{-o,--non-unique}'[allow non unique gid]'
     )
   ;|




Messages sorted by: Reverse Date, Date, Thread, Author