From: epg <> Date: Sat, 3 Apr 2004 06:03:07 +0000 (+0000) Subject: Drop -h and use Getopt::Std automatic --help. New $VERSION global. X-Git-Url: https://diplodocus.org/git/minc/commitdiff_plain/29c99d6c9ab65449be4e5b4aaf7cafa2c8796043?ds=sidebyside;hp=704e9caefb52692e7b2247002d65357034fa6715 Drop -h and use Getopt::Std automatic --help. New $VERSION global. --- diff --git a/minc b/minc index 790ecfe..83acac4 100755 --- a/minc +++ b/minc @@ -31,11 +31,13 @@ use Fcntl qw(O_WRONLY O_EXCL O_CREAT); use FileHandle; use File::Basename; use File::stat; -use Getopt::Std; +use Getopt::Std; $Getopt::Std::STANDARD_HELP_VERSION = 1; use Log::Dispatch; use Log::Dispatch::File; use POSIX qw(strftime WEXITSTATUS WIFEXITED); +our $VERSION = 1; + # If a filter set's header is $MAGIC_TO_TOKEN, that set is compared # against headers matching this regex (taken from procmail). my $MAGIC_TO_REGEX = '^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope |Apparently(-Resent)?)-To)'; @@ -54,7 +56,7 @@ my @SPAM; Dump (using Data::Dumper) the FILTERS list and exit. This is useful for testing the syntax of .mincfilter. -=item B<-h> +=item B<--help> Show help. @@ -78,19 +80,15 @@ our $run = 1; my $printfilenames = 0; our $opt_d; -our $opt_h; our $opt_n; our $opt_p; -if (not getopts('dhnp')) { +if (not getopts('dnp')) { exit(2); } if ($opt_d) { $dumpfilters = 1; -} elsif ($opt_h) { - print("Sorry bub, no help.\n"); - exit; } elsif ($opt_n) { $run = 0; }