From 9e6c25c03104b2fd7e862805039939bbcd3bd179 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 9 Aug 2001 13:57:29 +0000 Subject: add exclusion lists to _dd and check for redhat/mandrake in _user_admin --- Completion/Unix/Command/_dd | 13 +++++++------ Completion/Unix/Command/_user_admin | 31 ++++++++++++++++--------------- 2 files changed, 23 insertions(+), 21 deletions(-) (limited to 'Completion') 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]' ) -- cgit 1.4.1