From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12541 invoked from network); 8 Aug 2001 11:37:19 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Aug 2001 11:37:19 -0000 Received: (qmail 29015 invoked by alias); 8 Aug 2001 11:37:09 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15599 Received: (qmail 28998 invoked from network); 8 Aug 2001 11:37:08 -0000 Sender: kiddleo Message-ID: <3B712464.A588EE5B@u.genie.co.uk> Date: Wed, 08 Aug 2001 12:37:08 +0100 From: Oliver Kiddle X-Mailer: Mozilla 4.76 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: zsh-workers@sunsite.dk Subject: Re: PATCH: new and updated completions References: <3B6EA97A.CD6DCB4F@u.genie.co.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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]' )