4 local tmp common_args user_cmn_args
6 "-V[Set the alternate location for /etc]:Alternate etc dir:_files -/"
7 '-C[Specify a different configuration file]:Configuration file:_files -g "*.conf"'
8 '-q[Suppress rrror messages]'
11 '-n[Specify the name]:name:'
12 '-u[Specify the uid]:uid:'
15 '*::command:->commands' && ret=0
16 while [[ -n "$state" ]]; do
21 if (( CURRENT == 1 )); then
31 "-r[Remove the user's home directory]" \
32 "-Y[allow automatic updating of NIS database]" \
37 if [[ -r /etc/shells ]]; then
38 shells=( ${${(f)"$(</etc/shells)"}:#\#*} )
40 shells=( ${(M)commands:#*/(|[abckz]|tc|ba)sh} )
45 "-Y[allow automatic updating of NIS database]" \
46 '-n[Specify the name]:name:' \
47 '-u[Specify the uid]:uid:' \
48 '-c[Modify the comment]:comment:' \
49 "-d[Modify the home directory location]:home dir:_directories -W /" \
50 "-e[Modify the expiration date]:date:" \
51 "-p[Modify the password expiration date]:date:" \
52 "-g[Modify the main group]:group:_groups" \
53 "-G[Modify supplementary groups]:groups:_groups -S," \
54 "-l[Modify the user name]:name:" \
55 "-m[Attempt to create the user's directory]" \
56 "-M[Create the user’s home directory with the specified mode]:mode:" \
57 "-k[Skeleton for the home directory creation]:skeleton dir:_directories -W /" \
58 "-w[sets the default method used to set passwords]:methods:((no\:disable\ login yes\:force\ the\ password\ to\ be\ the\ account\ name none\:force\ a\ blank\ password random\:generate\ a\ random\ password))" \
59 "-s[specify the user shell]:shell:( $shells /sbin/nologin )" \
60 "-L[Set the login class]:class:" \
66 '-n[Specify the name]:name:' \
67 '-u[Specify the uid]:uid:' \
68 "-F[forces pw to print the details of an account]" \
69 "-P[outputs the account details in a more human readable form]" \
70 "-7[show account details in v7 format]" \
71 "-a[lists all users currently on file]" \
101 ":User to $words[1]:_users"
104 _message 'command not found'
111 'useradd[Add a user]'
112 'userdel[Delete a user]'
113 'usermod[Modify a user]'
114 'usershow[Show informations about a user]'
116 'groupdadd[Add a group]'
117 'groupdel[Delete a group]'
118 'groupmod[Modify a group]'
119 'groupshow[Show information about a group]'
122 'unlock[unlock a user]'
124 _values "pw command" $subcmds && return 0