Flail::Exec::Cmd::count - Flail "count" command


flail documentation Contained in the flail distribution.

Index


Code Index:

NAME

Top

Flail::Exec::Cmd::count - Flail "count" command

VERSION

Top

  Time-stamp: <2006-12-03 11:04:43 attila@stalphonsos.com>

SYNOPSIS

Top

  use Flail::Exec::Cmd::count;
  blah;

DESCRIPTION

Top

Describe the module.

AUTHOR

Top

  attila <attila@stalphonsos.com>

COPYRIGHT AND LICENSE

Top


flail documentation Contained in the flail distribution.
package Flail::Exec::Cmd::count;
use strict;
use Carp;
use Flail::Utils;
use base qw(Exporter);
use vars qw(@EXPORT @EXPORT_OK %EXPORT_TAGS);
@EXPORT_OK = qw(flail_count);
@EXPORT = ();
%EXPORT_TAGS = ( 'cmd' => \@EXPORT_OK );
 
sub flail_count {
    if (!defined($::FOLDER)) {
        print "no folder currently open\n";
        return;
    }
    my $do_list = 0;
    if (defined($_[0])) {
        if ($_[0] =~ /^-list$/) {
            shift(@_);
            $do_list = 1;
        }
    }
    if (!defined($_[0])) {
        push(@_, "marked");
    }
    foreach my $label (@_) {
        my @msgs = $::FOLDER->select_label($label);
        print "$label: ", scalar @msgs, " messages";
        print ": @msgs" if $do_list;
        print "\n";
    }
}

1;

__END__

##
# Local variables:
# mode: perl
# tab-width: 4
# perl-indent-level: 4
# cperl-indent-level: 4
# cperl-continued-statement-offset: 4
# indent-tabs-mode: nil
# comment-column: 40
# time-stamp-line-limit: 40
# End:
##