From 6688046702e1f2b684c593b4d519cbe1141cfadb Mon Sep 17 00:00:00 2001 From: pgoyette Date: Sun, 5 Dec 2010 04:34:22 +0000 Subject: [PATCH] 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. --- games/boggle/boggle/bog.c | 7 ++++--- games/pom/pom.c | 7 ++++--- games/snake/snake/snake.c | 12 ++++++++---- games/tetris/tetris.c | 5 +++-- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/games/boggle/boggle/bog.c b/games/boggle/boggle/bog.c index 0b5598325d0e..a3502d1e852e 100644 --- a/games/boggle/boggle/bog.c +++ b/games/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/games/pom/pom.c b/games/pom/pom.c index f4267d0c6379..91ed3f0d74ba 100644 --- a/games/pom/pom.c +++ b/games/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/games/snake/snake/snake.c b/games/snake/snake/snake.c index 2db387215f6f..7fedf522b564 100644 --- a/games/snake/snake/snake.c +++ b/games/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/games/tetris/tetris.c b/games/tetris/tetris.c index 9584026a3df3..7202cb316264 100644 --- a/games/tetris/tetris.c +++ b/games/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); }