From 497120e54b4ba4186e96a31905e98fc70f495ae2 Mon Sep 17 00:00:00 2001 From: fukachan Date: Wed, 7 Nov 2001 03:14:22 +0000 Subject: fmlthread -f filterlist ... --- fml/lib/FML/Process/ThreadTrack.pm | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'fml/lib/FML/Process/ThreadTrack.pm') diff --git a/fml/lib/FML/Process/ThreadTrack.pm b/fml/lib/FML/Process/ThreadTrack.pm index a2341122..48d5e392 100644 --- a/fml/lib/FML/Process/ThreadTrack.pm +++ b/fml/lib/FML/Process/ThreadTrack.pm @@ -4,7 +4,7 @@ # Copyright (C) 2000-2001 Ken'ichi Fukamachi # All rights reserved. # -# $FML: ThreadTrack.pm,v 1.5 2001/11/05 14:35:48 fukachan Exp $ +# $FML: ThreadTrack.pm,v 1.6 2001/11/06 22:52:27 fukachan Exp $ # package FML::Process::ThreadTrack; @@ -75,6 +75,7 @@ sub run my ($curproc, $args) = @_; my $config = $curproc->{ config }; my $argv = $curproc->command_line_argv(); + my $options = $curproc->command_line_options(); my $command = $argv->[ 0 ] || ''; # argumente for thread track module @@ -94,6 +95,10 @@ sub run my $thread = new Mail::ThreadTrack $ttargs; $thread->set_mode('text'); + if (defined $options->{ f }) { + _read_filter_list($thread, $options->{ f }); + } + $curproc->lock(); if ($command eq 'list' || $command eq 'summary') { @@ -128,6 +133,28 @@ sub run } +sub _read_filter_list +{ + my ($thread, $file) = @_; + + if (-f $file) { + use FileHandle; + my $fh = new FileHandle $file; + if (defined $fh) { + my ($key, $value); + while (<$fh>) { + chop; + ($key, $value) = split(/\s+/, $_, 2); + if ($key) { + $thread->add_filter( { $key => $value }); + } + } + $fh->close(); + } + } +} + + # $thread_id accepts MH style format. # MH style is expanded by C. sub _close -- cgit v1.2.1