From owner-freebsd-bugs Tue Apr 14 02:53:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA06195 for freebsd-bugs-outgoing; Tue, 14 Apr 1998 02:53:28 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from relay.ucb.crimea.ua (relay.ucb.crimea.ua [194.93.177.113]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA05984; Tue, 14 Apr 1998 09:52:02 GMT (envelope-from ru@ucb.crimea.ua) Received: (from ru@localhost) by relay.ucb.crimea.ua (8.8.8/8.8.8) id MAA17169; Tue, 14 Apr 1998 12:51:51 +0300 (EEST) (envelope-from ru) Message-ID: <19980414125150.05376@ucb.crimea.ua> Date: Tue, 14 Apr 1998 12:51:50 +0300 From: Ruslan Ermilov To: Poul-Henning Kamp , freebsd-bugs@FreeBSD.ORG Subject: Re: bin/6294: who(1) needs better argument parsing Mail-Followup-To: Poul-Henning Kamp , freebsd-bugs@FreeBSD.ORG References: <199804140643.XAA13598@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1i In-Reply-To: <199804140643.XAA13598@freefall.freebsd.org>; from Poul-Henning Kamp on Mon, Apr 13, 1998 at 11:43:19PM -0700 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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 #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