summaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authordcs <dcs@FreeBSD.org>1999-03-09 11:44:51 +0000
committerdcs <dcs@FreeBSD.org>1999-03-09 11:44:51 +0000
commit98c6f980becb2d5326dfb32822acc8791f202285 (patch)
treeb9e779676d02fff1d46668069d88c334fdd2a125 /games
parentf5ccad82da71fe40b484de65100b0d380f101bee (diff)
downloadFreeBSD-src-98c6f980becb2d5326dfb32822acc8791f202285.zip
FreeBSD-src-98c6f980becb2d5326dfb32822acc8791f202285.tar.gz
Document -D option. Give a more helpful error message for some cases.
PR: bin/10152 Obtained from: Matthew D. Fuller <fullermd@futuresouth.com>
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 57b36db..62265c0 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 6d7ec88..9d7671c 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)
OpenPOWER on IntegriCloud