'status>s', # for 'summary', 'list'
'l=s', # l = label
'label>l', # for 'summary, 'list'
+ 'c=s', # c = created-by
+ 'created-by>c', # for 'summary', 'list'
+ 'a=s', # a = assigned_to
+ 'assigned-to>a',# for 'summary', 'list'
# booleans
- 'is-open',
- 'is-closed',
+ 'is-open', # for 'summary', 'list'
+ 'is-closed', # for 'summary', 'list'
'help',
'version',
);
@new_issues = grep { $_->is_closed($cil) } @new_issues;
}
+ # filter out 'created by'
+ if ( defined $args->{c} ) {
+ @new_issues = grep { $args->{c} eq $_->created_by_email } @new_issues;
+ }
+
+ # filter out 'assigned to'
+ if ( defined $args->{a} ) {
+ @new_issues = grep { $args->{a} eq $_->assigned_to_email } @new_issues;
+ }
+
return \@new_issues;
}
Section: perl
Priority: optional
Architecture: all
-Depends: ${perl:Depends}, libgetopt-mixed-perl, libfile-touch-perl, libfile-slurp-perl, libclass-accessor-perl, libdatetime-perl
+Depends: ${perl:Depends}, libgetopt-mixed-perl, libfile-touch-perl, libfile-slurp-perl, libclass-accessor-perl, libdatetime-perl, libemail-find-perl
Description: command line issue tracker
'cil' allows easy command-line creation of an issue tracker. It saves each
issue locally and in plain text. Commands are given such that these issues can
Section: perl
Priority: optional
Architecture: all
-Depends: ${perl:Depends}, libgetopt-mixed-perl, libfile-touch-perl, libfile-slurp-perl, libclass-accessor-perl, libdatetime-perl
+Depends: ${perl:Depends}, libgetopt-mixed-perl, libfile-touch-perl, libfile-slurp-perl, libclass-accessor-perl, libdatetime-perl, libemail-find-perl
Description: command line issue tracker
'cil' allows easy command-line creation of an issue tracker. It saves each
issue locally and in plain text. Commands are given such that these issues can
local cur prev opts
# constants
- opts="--help --version --path --status --label --filename --is-open --is-closed"
+ opts="--help --version --path --status --label --filename --is-open --is-closed --assigned-to --created-by"
commands="init add summary list show status edit comment attach extract"
COMPREPLY=()
--- /dev/null
+Issue: 85eceee9
+CreatedBy: Andrew Chilton <andychilton@gmail.com>
+Inserted: 2008-06-27T13:18:47
+Updated: 2008-06-27T13:20:01
+
+Added the --created-by and --assigned-to filters.
+
+These work just on the email address and not the whole field. E.g.
+
+ $ cil list --created-by=andy@example.com
+ $ cil list --assigned-to=andy@example.org
+
+The short options for these are -c and -a.
Label: Milestone-v0.3
Label: Release-v0.2.0
Label: Type-Enhancement
+Comment: 02a9bb68
Comment: 4b71d0c3
Comment: 7eb313cd
Inserted: 2008-06-23T12:05:33
-Updated: 2008-06-27T12:40:51
+Updated: 2008-06-27T13:20:01
The ability to filter on various things would be nice. For example using these
list commands, though summary should work the same way:
return exists $closed->{$self->Status};
}
+sub assigned_to_email {
+ my ($self) = @_;
+
+ return CIL::Utils->extract_email_address( $self->AssignedTo );
+}
+
+sub created_by_email {
+ my ($self) = @_;
+
+ return CIL::Utils->extract_email_address( $self->CreatedBy );
+}
+
## ----------------------------------------------------------------------------
1;
## ----------------------------------------------------------------------------
use Carp;
use File::Slurp;
use File::Temp qw(tempfile);
+use Email::Find;
use POSIX qw(getpgrp tcgetpgrp);
use Fcntl qw(:DEFAULT :flock);
return;
}
+sub extract_email_address {
+ my ($class, $text) = @_;
+
+ my $email_address;
+ my $num_found = find_emails(
+ $text,
+ sub {
+ my ($mail_address, $text_email) = @_;
+ $email_address = $text_email;
+ }
+ );
+
+ return $email_address;
+}
+
## ----------------------------------------------------------------------------
1;
## ----------------------------------------------------------------------------