Date: Thu, 18 Feb 1999 09:56:51 -0700 From: Nate Williams <nate@mt.sri.com> To: Jun Kuriyama <kuriyama@sky.rim.or.jp> Cc: FreeBSD-current <FreeBSD-current@FreeBSD.ORG> Subject: Re: Error handling for src/usr.sbin/pccard/pccardc/* Message-ID: <199902181656.JAA09277@mt.sri.com> In-Reply-To: <36CC2F98.2E3C8A56@sky.rim.or.jp> References: <36C56288.D80AAC1E@sky.rim.or.jp> <199902131628.JAA18436@mt.sri.com> <36CC2F98.2E3C8A56@sky.rim.or.jp>
next in thread | previous in thread | raw e-mail | index | archive | help
> > > @@ -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? It was a 'typo'. > > > - fprintf(stderr, "usage: pccardc <subcommand> <arg> ...\n"); > > > - fprintf(stderr, "subcommands:\n"); > > > + fprintf(stderr, "Usage:\n"); > > > + fprintf(stderr, "\t%s <subcommand> <arg> ...\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. You just defined gratiutious. 'Is not necessary. Provides no additional functionality. Is different just to be different.' > > 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. :-) Philippe is the expert in the usafe of err/warn. Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902181656.JAA09277>