From: epg Date: Thu, 17 Apr 2014 04:46:30 +0000 (-0700) Subject: quick hack to make inc require-able X-Git-Url: https://diplodocus.org/git/minc/commitdiff_plain/0cb4aad71697fc326484fed99160f2e79a0ff594?hp=2b7b7a157352beeb44a9e9ecb0145981990dd973 quick hack to make inc require-able TODO: Take this further; lots of global code scattered around, including some that runs mh commands. --- diff --git a/minc b/minc index 1642c46..1d7a4c2 100755 --- a/minc +++ b/minc @@ -95,6 +95,7 @@ my $maxmsgs; my $norun; my $rebuild_dot_folders; +if (!caller()) { GetOptions( 'd' => \$dumpfilters, 'h|help' => \$help, @@ -104,6 +105,7 @@ GetOptions( ) or pod2usage(); $help and pod2usage(-exitstatus=>0, -verbose=>1); @ARGV == 0 or pod2usage(); +} our $run = !$norun; @@ -782,7 +784,7 @@ sub scan_spam { } -MAIN: { +if (!caller()) { my $st; if ($dumpfilters) { @@ -811,6 +813,8 @@ MAIN: { scan_spam(); } +1; + __END__