Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug path completion chsh -s



2014/08/24 04:31, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> I don't have BSD handy to test with, but the
> man page on MacOS claims it is using the BSD chpass.

It seems BSDs have different options than Darwin.
I only have FreeBSD, but checked the manpages of {Open|Net}BSD and
Dragonfly on their websites. The options are different among them,
so I only added options common to them.

I also removed Capitalization from the descriptions of options
(Specify --> specify, etc.).

diff --git a/Completion/Unix/Command/_chsh b/Completion/Unix/Command/_chsh
index 97552e3..4f6453e 100644
--- a/Completion/Unix/Command/_chsh
+++ b/Completion/Unix/Command/_chsh
@@ -1,26 +1,35 @@
 #compdef chsh chpass
 case $OSTYPE in
-(darwin*|*bsd*)
+(darwin*)
   _arguments : \
-      '-s[Specify user login shell]:shell:(${(Z+Cn+)"$(</etc/shells)"})' \
-      "-l[Specify location of user]:node:" \
-      "-u[Specify authentication name]:auth user:" \
+      '-s[specify user login shell]:shell:(${(Z+Cn+)"$(</etc/shells)"})' \
+      "-l[specify location of user]:node:" \
+      "-u[specify authentication name]:auth user:" \
       "1:user name:_users"
   ;;
+(*bsd*|dragonfly*)
+  # options common to most BSD flavors
+  _arguments : \
+      '(-a)-s[specify user login shell]:shell:(${(Z+Cn+)"$(</etc/shells)"})' \
+      '(-s)-a[passwd file entry]:colon-separated list:' \
+      '(-y)-l[change local password database]' \
+      '(-l)-y[change YP(NIS) password database]' \
+      '1:user name:_users'
+  ;;
 (linux-gnu)
   if { =chsh -v } >&/dev/null
   then
       local -a opts shells
       shells=( $(=chsh -l) )
       _arguments : \
-	  "(-)-s[Specify your login shell]:shell:($shells)" \
-	  "(-)--shell[Specify your login shell]:shell:($shells)" \
-	  "(-)-l[Print shells in /etc/shells]" \
-	  "(-)--list-shells[Print shells in /etc/shells]" \
-	  "(-)-u[Print a usage message and exit]" \
-	  "(-)--help[Print a usage message and exit]" \
-	  "(-)-v[Print version information and exit]" \
-	  "(-)--version[Print version information and exit]" \
+	  "(-)-s[specify your login shell]:shell:($shells)" \
+	  "(-)--shell[specify your login shell]:shell:($shells)" \
+	  "(-)-l[print shells in /etc/shells]" \
+	  "(-)--list-shells[print shells in /etc/shells]" \
+	  "(-)-u[print a usage message and exit]" \
+	  "(-)--help[print a usage message and exit]" \
+	  "(-)-v[print version information and exit]" \
+	  "(-)--version[print version information and exit]" \
 	  "1:user name:_users"
       return
   fi





Messages sorted by: Reverse Date, Date, Thread, Author