about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Completion/Unix/Command/_dd13
-rw-r--r--Completion/Unix/Command/_user_admin31
3 files changed, 30 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index 45e24739d..a2193c18e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-08-09  Oliver Kiddle  <opk@zsh.org>
+
+	* 15606: Completion/Unix/Command/_dd: add exclusion lists
+
+	* 15599: Completion/Unix/Command/_user_admin: detect redhat or
+	mandrake before completing redhat's extensions
+
 2001-08-08  Wayne Davison  <wayned@users.sourceforge.net>
 
 	* 15596: Src/Zle/compmatch.c, Src/Zle/compresult.c,
diff --git a/Completion/Unix/Command/_dd b/Completion/Unix/Command/_dd
index 0c950f047..1a2ae871a 100644
--- a/Completion/Unix/Command/_dd
+++ b/Completion/Unix/Command/_dd
@@ -1,16 +1,17 @@
 #compdef dd
 
-local opts
-
 _values -w 'option' \
   'if[specify input file]:input file:_tilde_files' \
   'of[specify output file]:output file:_tilde_files' \
-  'ibs[input block size]:block size (bytes)' \
-  'obs[output block size]:block size (bytes)' \
-  'bs[block size]:block size (bytes)' \
+  '(bs)ibs[input block size]:block size (bytes)' \
+  '(bs)obs[output block size]:block size (bytes)' \
+  '(ibs obs)bs[block size]:block size (bytes)' \
   'cbs[conversion buffer size]:buffer size (bytes)' \
   'skip[input blocks initially skipped]:blocks' \
   'seek[output blocks initially skipped]:blocks' \
   'files[specify number of input files to copy and concatenate]:number of files' \
   'count[number of input blocks to copy]:blocks' \
-  'conv[specify conversions to apply]:conversion:_values -s , "conversion" ascii ebcdic ibm block unblock lcase ucase swab noerror sync'
+  'conv[specify conversions to apply]:conversion:_values -s , conversion
+    "(ebcdic ibm)ascii" "(ascii ibm)ebcdic" "(ascii ebcdic)ibm"
+    "(unblock)block" "(block)unblock"
+    "(ucase)lcase" "(lcase)ucase" swab noerror sync'
diff --git a/Completion/Unix/Command/_user_admin b/Completion/Unix/Command/_user_admin
index 831f365b8..5b467ab18 100644
--- a/Completion/Unix/Command/_user_admin
+++ b/Completion/Unix/Command/_user_admin
@@ -1,6 +1,9 @@
 #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 redhat
+
+[[ -e /etc/redhat-release || -e /etc/mandrake-release ]]
+redhat=$?
 
 if [[ $service = user* ]]; then
   if [[ -r /etc/shells ]]; then
@@ -17,31 +20,29 @@ if [[ $service = user* ]]; then
     '(-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
+    (( redhat )) || 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]"
+    (( redhat )) || 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 +53,7 @@ else
   args=( '-g+[gid]:gid' '-o[allow non unique gid]' )
   if [[ $service = groupadd ]]; then
     args=( $args[@] ':group name' )
-    [[ $OSTYPE = linux* ]] && args=( $args[@]
+    (( redhat )) || args=( $args[@]
       '-r[create system group]'
       '-f[force]'
     )