--- trunk/mbox2index.pl 2004/05/07 11:25:01 17 +++ trunk/mbox2index.pl 2004/05/08 20:34:26 27 @@ -4,8 +4,29 @@ use Data::Dumper; use Date::Parse; use POSIX qw(strftime); +use Getopt::Long; -my $mws = MWS->new('global.conf'); +# are we called from this script? +my $recursive = 0; + +my $r = GetOptions("recursive" => \$recursive); + +my $config_file = shift @ARGV || 'global.conf'; + +if (! -f $config_file) { + print qq{Usage: $0 [/path/to/local.conf] + +If local.conf is not specified, global.conf in current directory will +be used. +}; + exit 1; +} + +my $mws = MWS->new($config_file); + +$mws->create_index if (! $recursive); + +print STDERR "starting indexing..."; my $debug = 1;