Date: Tue, 14 Apr 1998 12:51:50 +0300 From: Ruslan Ermilov <ru@ucb.crimea.ua> To: Poul-Henning Kamp <phk@FreeBSD.ORG>, freebsd-bugs@FreeBSD.ORG Subject: Re: bin/6294: who(1) needs better argument parsing Message-ID: <19980414125150.05376@ucb.crimea.ua> In-Reply-To: <199804140643.XAA13598@freefall.freebsd.org>; from Poul-Henning Kamp on Mon, Apr 13, 1998 at 11:43:19PM -0700 References: <199804140643.XAA13598@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 commit the patch you made for who.1 in -stable. 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?19980414125150.05376>