From owner-freebsd-current Thu Feb 18 7:20:45 1999 Delivered-To: freebsd-current@freebsd.org Received: from mail.kt.rim.or.jp (mail.kt.rim.or.jp [202.247.130.53]) by hub.freebsd.org (Postfix) with ESMTP id 035A5115AD for ; Thu, 18 Feb 1999 07:20:09 -0800 (PST) (envelope-from kuriyama@sky.rim.or.jp) Received: from moon.sky.rim.or.jp (ppp526.kt.rim.or.jp [202.247.140.176]) by mail.kt.rim.or.jp (8.8.8/3.6W-RIMNET-98-06-09) with ESMTP id AAA27613 for ; Fri, 19 Feb 1999 00:20:07 +0900 (JST) Received: from sky.rim.or.jp (earth.sky.rim.or.jp [192.168.1.2]) by moon.sky.rim.or.jp (8.8.8/3.5Wpl4/moon-1.0) with ESMTP id AAA07053 for ; Fri, 19 Feb 1999 00:20:03 +0900 (JST) Message-ID: <36CC2F98.2E3C8A56@sky.rim.or.jp> Date: Fri, 19 Feb 1999 00:19:52 +0900 From: Jun Kuriyama X-Mailer: Mozilla 4.06 [ja] (Win95; I) MIME-Version: 1.0 To: FreeBSD-current Subject: Re: Error handling for src/usr.sbin/pccard/pccardc/* References: <36C56288.D80AAC1E@sky.rim.or.jp> <199902131628.JAA18436@mt.sri.com> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Nate Williams wrote: > > @@ -138,9 +138,9 @@ > > usage(msg) > > char *msg; > > { > > - warnx("enabler: %s", msg); > > + fprintf(stderr, "enabler: %s\n", msg); > > fprintf(stderr, > > -"usage: pccardc enabler slot driver [-m addr size] [-a iobase] [-i irq]\n"); > > +"Usage: enabler slot driver [-m addr size] [-a iobase] [-i irq]\n"); > > The usage really is 'pccardc enabled', not 'enabler', so this should > stay, or at least converted to use argv[0] to be consistent with > the other changes. As Philippe Charnier said, I'll keep last line as original. But it seems replacing warnx with fprintf(stderr, ) is reasonable, right? I cannot understand about usage of "enabled". Is this simply English representation issue? > > - fprintf(stderr, "usage: pccardc ...\n"); > > - fprintf(stderr, "subcommands:\n"); > > + fprintf(stderr, "Usage:\n"); > > + fprintf(stderr, "\t%s ...\n", argv[0]); > > + fprintf(stderr, "Subcommands:\n"); > > for (i = 0; subcommands[i].name; i++) > > - fprintf(stderr, "\t%s\n\t\t%s\n", > > + fprintf(stderr, "\t%s\t: %s\n", > > subcommands[i].name, subcommands[i].help); > > However, I'm not sure why we are changing the output. It seems > gratiutious. I cannot find "gratiutious" in my dictionary... But changing output is not necessary, I'll keep it as original. > Again, we use warn one place, and then err. Any chance of keeping it > consistent in all places. I think we should use "warn" when program can continue to work and use "err" when cannot continue to work and exit, is it right? Of course, err() should not use to display usage, as Philippe said. :-) -- Jun Kuriyama // kuriyama@sky.rim.or.jp // kuriyama@FreeBSD.ORG To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message