zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: new and updated completions
Date: Wed, 08 Aug 2001 12:37:08 +0100	[thread overview]
Message-ID: <3B712464.A588EE5B@u.genie.co.uk> (raw)
In-Reply-To: <m34rrlz2ew.fsf@giants.mandrakesoft.com>

Chmouel Boudjnah wrote:
> 
> > anyone can think of a good way to detect RedHat/Mandrake, please let me
> 
> /etc/{mandrake,redhat}-release

Perfect. Thanks.

Oliver

Index: Completion/Unix/Command/_user_admin
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_user_admin,v
retrieving revision 1.1
diff -u -r1.1 _user_admin
--- Completion/Unix/Command/_user_admin 2001/08/06 14:42:04     1.1
+++ Completion/Unix/Command/_user_admin 2001/08/08 11:32:58
@@ -1,6 +1,6 @@
 #compdef useradd usermod groupadd groupmod
 
-local args shells home=${${words[(r)-D]:+b}:-d} sun=" -s"
+local args shells home=${${words[(r)-D]:+b}:-d} sun
 
 if [[ $service = user* ]]; then
   if [[ -r /etc/shells ]]; then
@@ -17,31 +17,29 @@
     '(-D)-g+[initial group]:initial group:_groups'
     '(-D)-G+[supplementary groups]:supplementary groups:_groups -S,'
     "(-D)-s+[shell]:shell:( $shells /dev/null )"
-    '(-D)-m[create home directory]'
+    '(-D -M)-m[create home directory]'
     '(-D)-u[uid]:uid'
     '(-D)-o[allow non unique uid]'
   )
   [[ $OSTYPE = linux* ]] && args=( $args[@] 
-      '(-D)-p+[specify encrypted password]:encrypted password' )
+      '(-D -U -L)-p+[specify encrypted password]:encrypted password' )
 
   if [[ $service = useradd ]]; then
-    if [[ $OSTYPE = linux* ]]; then
-      args=( $args[@]
-       "(-D -k)-M[don't create home]"
-       '(-D)-r[create system account]'
-       "(-D)-n[don't create mirrored user]"
-      )
-      unset sun
-    fi
+    [[ -e /etc/redhat-release ]] && args=( $args[@]
+      "(-D -k -m)-M[don't create home]"
+      '(-D)-r[create system account]'
+      "(-D)-n[don't create mirrored user]"
+    )
+    [[ $OSTYPE = linux* ]] || sun=" -s"
     args=( $args[@]
       "(-c -G -m -k -M -p -u -o -n -r$sun)-D[modify or display
defaults]"
       '(-D -M)-k[skeleton home directory]:skeleton
directory:_directories -W /'
       ':username'
     )
   else
-    [[ $OSTYPE = linux* ]] && args=( $args[@]
-       "(-U)-L[lock user's password]"
-       "(-L)-U[unlock user's password]"
+    [[ -e /etc/redhat-release ]] && args=( $args[@]
+       "(-U -p)-L[lock user's password]"
+       "(-L -p)-U[unlock user's password]"
     )
     args=( $args[@]
       '-l[specify new user name]:new username'
@@ -52,7 +50,7 @@
   args=( '-g+[gid]:gid' '-o[allow non unique gid]' )
   if [[ $service = groupadd ]]; then
     args=( $args[@] ':group name' )
-    [[ $OSTYPE = linux* ]] && args=( $args[@]
+    [[ -e /etc/redhat-release ]] && args=( $args[@]
       '-r[create system group]'
       '-f[force]'
     )


  parent reply	other threads:[~2001-08-08 11:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-06 14:28 Oliver Kiddle
2001-08-06 14:30 ` Chmouel Boudjnah
2001-08-06 17:43   ` Borsenkow Andrej
2001-08-06 17:47     ` Chmouel Boudjnah
2001-08-08 11:37   ` Oliver Kiddle [this message]
2001-08-08 12:06     ` Chmouel Boudjnah
2001-08-08 15:52     ` Bart Schaefer
2001-08-08 17:17       ` Oliver Kiddle
2001-08-09 15:58         ` Bart Schaefer
2001-08-11 14:20       ` Peter Stephenson
2001-08-07 10:36 ` Sven Wischnowsky
2001-08-07 11:04   ` Oliver Kiddle
2001-08-08  7:19     ` Sven Wischnowsky
2001-08-08 17:23       ` Oliver Kiddle

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=3B712464.A588EE5B@u.genie.co.uk \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

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

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

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

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