From owner-freebsd-bugs Fri Apr 17 06:00:03 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA15752 for freebsd-bugs-outgoing; Fri, 17 Apr 1998 06:00:03 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA15714; Fri, 17 Apr 1998 06:00:02 -0700 (PDT) (envelope-from gnats) Date: Fri, 17 Apr 1998 06:00:02 -0700 (PDT) Message-Id: <199804171300.GAA15714@hub.freebsd.org> To: freebsd-bugs Cc: From: Ruslan Ermilov Subject: Re: bin/6294: who(1) needs better argument parsing Reply-To: Ruslan Ermilov Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/6294; it has been noted by GNATS. From: Ruslan Ermilov To: Poul-Henning Kamp , 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 #include #include +#include #include #include #include @@ -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