Date: Fri, 17 Apr 1998 06:00:02 -0700 (PDT) From: Ruslan Ermilov <ru@ucb.crimea.ua> To: freebsd-bugs Subject: Re: bin/6294: who(1) needs better argument parsing Message-ID: <199804171300.GAA15714@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/6294; it has been noted by GNATS. From: Ruslan Ermilov <ru@ucb.crimea.ua> To: Poul-Henning Kamp <phk@FreeBSD.ORG>, freebsd-gnats-submit@FreeBSD.ORG Cc: Subject: Re: bin/6294: who(1) needs better argument parsing Date: Fri, 17 Apr 1998 15:49:22 +0300 On Mon, Apr 13, 1998 at 11:43:19PM -0700, Poul-Henning Kamp wrote: > Old Synopsis: manpage for who(1) has inaccurate synopsis > New Synopsis: who(1) needs better argument parsing > > State-Changed-From-To: open-suspended > State-Changed-By: phk > State-Changed-When: Mon Apr 13 23:42:31 PDT 1998 > State-Changed-Why: > committed a compromise change. > -> suspended Here is a patch. If you like it, please commit in in -stable too. And, please, phk, commit the patch between 1.5 and 1.6 you made for who.1 in -stable too! Index: who.c =================================================================== RCS file: /usr/FreeBSD-CVS/src/usr.bin/who/who.c,v retrieving revision 1.5 diff -u -r1.5 who.c --- who.c 1997/08/26 11:14:57 1.5 +++ who.c 1998/04/14 09:40:59 @@ -54,6 +54,7 @@ #include <locale.h> #include <pwd.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> @@ -72,6 +73,9 @@ struct passwd *pw; FILE *ufp, *file(); char *t; + + if (getopt(argc, argv, "") != -1) + usage(); (void) setlocale(LC_TIME, ""); ----------------------------------------------- And here is it's work: # who -z who: illegal option -- z usage: who [file] who am i # who dev cuac00 Apr 14 12:33 bill ttyp0 Apr 14 09:08 (wks-1-254) ru ttyp1 Apr 14 09:19 (wks-1-250) ru ttyp2 Apr 14 08:15 (wks-1-250) ru ttyp3 Apr 14 12:09 (wks-1-250) ru ttyp4 Apr 14 10:07 (wks-1-250) # who 1 who: 1: No such file or directory # who 1 2 ru ttyp2 Apr 14 08:15 (wks-1-250) # who 1 2 3 usage: who [file] who am i Regards, -- Ruslan Ermilov System Administrator ru@ucb.crimea.ua United Commercial Bank +380-652-247647 Simferopol, Crimea 2426679 ICQ Network, UIN To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804171300.GAA15714>