summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpgoyette <pgoyette@NetBSD.org>2010-12-05 04:34:22 +0000
committerpgoyette <pgoyette@NetBSD.org>2010-12-05 04:34:22 +0000
commitea061499cfca6ed03384392d6972b6527402a242 (patch)
treeb79d765a910ae7f5543e902a5e680c336194aa1d
parent7a7613e47c9abc7a70376d4a03f021988f49899e (diff)
downloadbsdgames-darwin-ea061499cfca6ed03384392d6972b6527402a242.tar.gz
bsdgames-darwin-ea061499cfca6ed03384392d6972b6527402a242.tar.zst
bsdgames-darwin-ea061499cfca6ed03384392d6972b6527402a242.zip
Fix a few of the games to use getprogname() in their usage() functions.
Suggested by Joerg. XXX There are probably many more that have their progname hard-coded, but XXX I'm not up for a wholesale roto-till at the moment.
-rw-r--r--boggle/boggle/bog.c7
-rw-r--r--pom/pom.c7
-rw-r--r--snake/snake/snake.c12
-rw-r--r--tetris/tetris.c5
4 files changed, 19 insertions, 12 deletions
diff --git a/boggle/boggle/bog.c b/boggle/boggle/bog.c
index 0b559832..a3502d1e 100644
--- a/boggle/boggle/bog.c
+++ b/boggle/boggle/bog.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bog.c,v 1.25 2010/12/05 04:11:51 pgoyette Exp $ */
+/* $NetBSD: bog.c,v 1.26 2010/12/05 04:34:22 pgoyette Exp $ */
/*-
* Copyright (c) 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\
#if 0
static char sccsid[] = "@(#)bog.c 8.2 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: bog.c,v 1.25 2010/12/05 04:11:51 pgoyette Exp $");
+__RCSID("$NetBSD: bog.c,v 1.26 2010/12/05 04:34:22 pgoyette Exp $");
#endif
#endif /* not lint */
@@ -707,6 +707,7 @@ static void
usage(void)
{
(void) fprintf(stderr,
- "usage: boggle [-bd] [-s#] [-t#] [-w#] [+[+]] [boardspec]\n");
+ "usage: %s [-bd] [-s#] [-t#] [-w#] [+[+]] [boardspec]\n",
+ getprogname());
exit(1);
}
diff --git a/pom/pom.c b/pom/pom.c
index f4267d0c..91ed3f0d 100644
--- a/pom/pom.c
+++ b/pom/pom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pom.c,v 1.19 2009/08/12 08:23:20 dholland Exp $ */
+/* $NetBSD: pom.c,v 1.20 2010/12/05 04:34:22 pgoyette Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -41,7 +41,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\
#if 0
static char sccsid[] = "@(#)pom.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: pom.c,v 1.19 2009/08/12 08:23:20 dholland Exp $");
+__RCSID("$NetBSD: pom.c,v 1.20 2010/12/05 04:34:22 pgoyette Exp $");
#endif
#endif /* not lint */
@@ -272,6 +272,7 @@ static void
badformat(void)
{
warnx("illegal time format");
- (void)fprintf(stderr, "usage: pom [[[[[cc]yy]mm]dd]HH]\n");
+ (void)fprintf(stderr, "usage: %s [[[[[cc]yy]mm]dd]HH]\n",
+ getprogname());
exit(EXIT_FAILURE);
}
diff --git a/snake/snake/snake.c b/snake/snake/snake.c
index 2db38721..7fedf522 100644
--- a/snake/snake/snake.c
+++ b/snake/snake/snake.c
@@ -1,4 +1,4 @@
-/* $NetBSD: snake.c,v 1.26 2009/08/12 08:48:15 dholland Exp $ */
+/* $NetBSD: snake.c,v 1.27 2010/12/05 04:34:22 pgoyette Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\
#if 0
static char sccsid[] = "@(#)snake.c 8.2 (Berkeley) 1/7/94";
#else
-__RCSID("$NetBSD: snake.c,v 1.26 2009/08/12 08:48:15 dholland Exp $");
+__RCSID("$NetBSD: snake.c,v 1.27 2010/12/05 04:34:22 pgoyette Exp $");
#endif
#endif /* not lint */
@@ -180,9 +180,13 @@ main(argc, argv)
case '?':
default:
#ifdef DEBUG
- fputs("usage: snake [-d seed] [-w width] [-l length] [-t]\n", stderr);
+ fprintf(stderr,
+ "usage: %s [-d seed] [-w width] [-l length] [-t]\n",
+ getprogname());
#else
- fputs("usage: snake [-w width] [-l length] [-t]\n", stderr);
+ fprintf(stderr,
+ "usage: %s [-w width] [-l length] [-t]\n",
+ getprogname());
#endif
exit(1);
}
diff --git a/tetris/tetris.c b/tetris/tetris.c
index 9584026a..7202cb31 100644
--- a/tetris/tetris.c
+++ b/tetris/tetris.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tetris.c,v 1.22 2009/08/12 08:51:21 dholland Exp $ */
+/* $NetBSD: tetris.c,v 1.23 2010/12/05 04:34:23 pgoyette Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -328,6 +328,7 @@ onintr(int signo __unused)
static void
usage(void)
{
- (void)fprintf(stderr, "usage: tetris [-ps] [-k keys] [-l level]\n");
+ (void)fprintf(stderr, "usage: %s [-ps] [-k keys] [-l level]\n",
+ getprogname());
exit(1);
}