diff options
author | 2006-10-31 18:15:15 +0000 | |
---|---|---|
committer | 2006-10-31 18:15:15 +0000 | |
commit | 741f05d375c3c1f8fb7076fcf95dea92e06f1b34 (patch) | |
tree | f738af016689bf33663f2b14d11b8605b5786a34 | |
parent | other galaxies exist! (diff) | |
download | wireguard-openbsd-741f05d375c3c1f8fb7076fcf95dea92e06f1b34.tar.xz wireguard-openbsd-741f05d375c3c1f8fb7076fcf95dea92e06f1b34.zip |
Remove -h flag and simplify usage output to one line, like most
other programs.
Vote to simplify usage jmc@, OK martin@.
-rw-r--r-- | games/backgammon/backgammon/backgammon.6 | 7 | ||||
-rw-r--r-- | games/backgammon/common_source/subs.c | 32 |
2 files changed, 16 insertions, 23 deletions
diff --git a/games/backgammon/backgammon/backgammon.6 b/games/backgammon/backgammon/backgammon.6 index 4c92b9c0163..5bc0c40f39e 100644 --- a/games/backgammon/backgammon/backgammon.6 +++ b/games/backgammon/backgammon/backgammon.6 @@ -1,4 +1,4 @@ -.\" $OpenBSD: backgammon.6,v 1.15 2006/10/31 06:10:34 ray Exp $ +.\" $OpenBSD: backgammon.6,v 1.16 2006/10/31 18:15:15 ray Exp $ .\" .\" Copyright (c) 1980, 1993 .\" The Regents of the University of California. All rights reserved. @@ -78,11 +78,6 @@ player is white (implies n) recover previously saved game from .Ar file .El -.Pp -.\" -An argument of -.Fl h -gets a description of possible arguments. .Sh QUICK REFERENCE When the program prompts by typing only your color, type a space or carriage return to roll, or diff --git a/games/backgammon/common_source/subs.c b/games/backgammon/common_source/subs.c index 4db117aad64..ce108cc07e3 100644 --- a/games/backgammon/common_source/subs.c +++ b/games/backgammon/common_source/subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subs.c,v 1.14 2006/10/29 20:02:41 martin Exp $ */ +/* $OpenBSD: subs.c,v 1.15 2006/10/31 18:15:15 ray Exp $ */ /* * Copyright (c) 1980, 1993 @@ -33,12 +33,14 @@ #if 0 static char sccsid[] = "@(#)subs.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: subs.c,v 1.14 2006/10/29 20:02:41 martin Exp $"; +static char rcsid[] = "$OpenBSD: subs.c,v 1.15 2006/10/31 18:15:15 ray Exp $"; #endif #endif /* not lint */ #include "back.h" +__dead void usage(void); + int buffnum; char outbuff[BUFSIZ]; @@ -46,15 +48,6 @@ static const char plred[] = "Player is red, computer is white."; static const char plwhite[] = "Player is white, computer is red."; static const char nocomp[] = "(No computer play.)"; -const char *const descr[] = { - "Usage: backgammon [-] [-nrwb] [-s <file>]\n", - "\t-h\tget this list\n\t-n\tdon't ask for rules or instructions", - "\t-r\tplayer is red (implies n)\n\t-w\tplayer is white (implies n)", - "\t-b\ttwo players, red and white (implies n)", - "\t-s file\trecover previously saved game from file", - 0 -}; - void errexit(s) const char *s; @@ -210,7 +203,7 @@ getarg(argc,argv) int ch; int j; - while ((ch = getopt(argc, argv, "bdhnrs:w")) != -1) + while ((ch = getopt(argc, argv, "bdnrs:w")) != -1) switch((char)ch) { case 'n': /* don't ask if rules or instructions needed */ if (rflag) @@ -252,15 +245,20 @@ getarg(argc,argv) break; default: /* print cmdline options */ - case 'h': - for (j = 0; descr[j] != NULL; j++) - printf("%s\n", descr[j]); - exit(0); - break; + usage(); } /* end switch */ } void +usage(void) +{ + extern char *__progname; + + fprintf(stderr, "usage: %s [-bdnrw] [-s <file>]\n", __progname); + exit(1); +} + +void init() { int i; |