From 0cb4aad71697fc326484fed99160f2e79a0ff594 Mon Sep 17 00:00:00 2001 From: epg Date: Wed, 16 Apr 2014 21:46:30 -0700 Subject: [PATCH] quick hack to make inc require-able TODO: Take this further; lots of global code scattered around, including some that runs mh commands. --- minc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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__ -- 2.56.0