also see https://github.com/shlomif/fortune-mod/issues/62 .
#endif
while ((ch = getopt(argc, argv,
- "ac" DEBUG_GETOPT "efilm:n:" OFFENSIVE_GETOPT "suvw")) != EOF)
+ "ac" DEBUG_GETOPT "efhilm:n:" OFFENSIVE_GETOPT "suvw")) != EOF)
{
switch (ch)
{
case 'c':
Show_filename = true;
break;
+ case 'h':
case '?':
default:
usage();
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use 5.014;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+use FortTestInst ();
+use Test::More tests => 1;
+use Test::Trap
+ qw( trap $trap :flow:stderr(systemsafe):stdout(systemsafe):warn );
+
+{
+ my $inst_dir = FortTestInst::install("fortune-help-flag");
+ my @cmd = ( $inst_dir->child( 'games', 'fortune' ), "-h", );
+
+ print "Running [@cmd]\n";
+ trap
+ {
+ system(@cmd);
+ };
+
+ # TEST
+ unlike( $trap->stderr(), qr/\A[^\n]*?invalid option/ms,
+ "negative integer" );
+}