aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorDaniel C. Sobral <dcs@FreeBSD.org>1999-03-09 11:44:51 +0000
committerDaniel C. Sobral <dcs@FreeBSD.org>1999-03-09 11:44:51 +0000
commitd0194c03fb908d887912d1edbd6e6340aee64b7b (patch)
tree399d746e0bcb93d4f4ccb10a51ec3eb8fd88079b /games
parent269dfbee64dab12210fe203af4daf19f1f77a35f (diff)
downloadsrc-d0194c03fb908d887912d1edbd6e6340aee64b7b.tar.gz
src-d0194c03fb908d887912d1edbd6e6340aee64b7b.zip
Document -D option. Give a more helpful error message for some cases.
PR: bin/10152 Obtained from: Matthew D. Fuller <fullermd@futuresouth.com>
Notes
Notes: svn path=/head/; revision=44599
Diffstat (limited to 'games')
-rw-r--r--games/fortune/fortune/fortune.68
-rw-r--r--games/fortune/fortune/fortune.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/games/fortune/fortune/fortune.6 b/games/fortune/fortune/fortune.6
index 57b36dbddeed..62265c058ea0 100644
--- a/games/fortune/fortune/fortune.6
+++ b/games/fortune/fortune/fortune.6
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)fortune.6 8.3 (Berkeley) 4/19/94
-.\" $Id$
+.\" $Id: fortune.6,v 1.5 1997/02/22 14:46:50 peter Exp $
.\"
.Dd April 19, 1994
.Dt FORTUNE 6
@@ -43,7 +43,7 @@
.Nd "print a random, hopefully interesting, adage"
.Sh SYNOPSIS
.Nm fortune
-.Op Fl aefilosw
+.Op Fl aDefilosw
.Op Fl m Ar pattern
.Oo
.Op Ar \&N%
@@ -63,6 +63,10 @@ Choose from all lists of maxims, both offensive and not.
(See the
.Fl o
option for more information on offensive fortunes.)
+.It Fl D
+Enable additional debugging output.
+Specify this option multiple times for more verbose output.
+Only available if compiled with -DDEBUG.
.It Fl e
Consider all fortune files to be of equal size (see discussion below
on multiple files).
diff --git a/games/fortune/fortune/fortune.c b/games/fortune/fortune/fortune.c
index 6d7ec8819030..9d7671c3ed8d 100644
--- a/games/fortune/fortune/fortune.c
+++ b/games/fortune/fortune/fortune.c
@@ -799,8 +799,12 @@ int check_for_offend;
datfile = copy(file, (unsigned int) (strlen(file) + 4)); /* +4 for ".dat" */
strcat(datfile, ".dat");
if (access(datfile, R_OK) < 0) {
+ DPRINTF(2, (stderr, "FALSE (no readable \".dat\" file)\n"));
+#ifdef DEBUG
+ if (Debug < 2)
+ DPRINTF(0, (stderr, "Warning: file \"%s\" unreadable\n", datfile));
+#endif
free(datfile);
- DPRINTF(2, (stderr, "FALSE (no \".dat\" file)\n"));
return FALSE;
}
if (datp != NULL)