Date: Mon, 10 Jun 2002 02:22:07 +1000 (EST) From: Andrew <andrew@ugh.net.au> To: freebsd-gnats-submit@FreeBSD.org Cc: dima@unixfreak.org, <freebsd-bugs@FreeBSD.org> Subject: Re: bin/25278: bs accepts -s -c but not -sc Message-ID: <20020610021320.X94582-200000@starbug.ugh.net.au>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Well I've rewritten the changes to try and minise the diffs...not too
successfuly however but hopefully enough to see them committed.
Here is a patch to split usage off into a seperate function.
(other patches to follow)
Thanks,
Andrew
[-- Attachment #2 --]
--- /usr/src/games/bs/bs.c Mon Feb 21 14:07:31 2000
+++ bs.c Mon Jun 10 01:26:20 2002
@@ -1110,6 +1110,17 @@
return(sgetc("YN") == 'Y');
}
+static void usage(void) {
+
+ (void) fprintf(stderr, "Usage: bs [-s | -b] [-c]\n"
+ "\tWhere the options are:\n"
+ "\t-s : play a salvo game\n"
+ "\t-b : play a blitz game\n"
+ "\t-c : ships may be adjacent\n");
+ exit(1);
+}
+
+
static void do_options(c,op)
int c;
char *op[];
@@ -1124,12 +1135,7 @@
{
default:
case '?':
- (void) fprintf(stderr, "Usage: battle [-s | -b] [-c]\n");
- (void) fprintf(stderr, "\tWhere the options are:\n");
- (void) fprintf(stderr, "\t-s : play a salvo game\n");
- (void) fprintf(stderr, "\t-b : play a blitz game\n");
- (void) fprintf(stderr, "\t-c : ships may be adjacent\n");
- exit(1);
+ usage();
break;
case '-':
switch(op[i][1])
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020610021320.X94582-200000>
