# booleans
'is-open', # for 'summary', 'list'
'is-closed', # for 'summary', 'list'
+ 'is-mine', # for 'summary', 'list'
'help',
'version',
);
'version' => 1,
'is-open' => 1,
'is-closed' => 1,
+ 'is-mine' => 1,
);
## ----------------------------------------------------------------------------
# don't filter if we haven't been given anything
return $issues unless %$args;
+ # check that they aren't filtering on both --assigned-to and --is-mine
+ if ( defined $args->{a} and defined $args->{'is-mine'} ) {
+ fatal("the --assigned-to and --is-mine filters are mutually exclusive");
+ }
+
# take a copy of the whole lot first (so we don't destroy the input list)
my @new_issues = @$issues;
}
# filter out 'assigned to'
+ $args->{a} = $cil->UserEmail
+ if defined $args->{'is-mine'};
if ( defined $args->{a} ) {
@new_issues = grep { $args->{a} eq $_->assigned_to_email } @new_issues;
}
Commands:
init [--path=PATH]
add
- summary [--status=STATUS] [--label=LABEL] [--is-open] [--is-closed]
- list [--status=STATUS] [--label=LABEL] [--is-open] [--is-closed]
+ summary [FILTERS...]
+ list [FILTERS...]
show ISSUE
status ISSUE NEW_STATUS
edit ISSUE
extract ATTACHMENT [--filename=FILENAME]
fsck
+Filters:
+ --status=?
+ --is-open
+ --is-closed
+ --label=?
+ --assigned-to=?
+ --is-mine
+
See <http://kapiti.geek.nz/software/cil.html> for further information.
Report bugs to <andychilton -at- gmail -dot- com>.
END_USAGE
Creates a local '.cil' file and an 'issues' directory. If PATH is specified,
the config file and directory will be created in the destination directory.
-=item summary [--status=STATUS] [--label=LABEL] [--is-open] [--is-closed]
+=item summary [filters]
Displays a one line summary for each issue. You may filter on both the Status
and Label fields.
-=item list [--status=STATUS] [--label=LABEL] [--is-open] [--is-closed]
+=item list [filters]
Shows each issue with more information. You may filter on both the Status and
Label fields.
=back
+=head1 FILTERS
+
+Filters can be used on both the C<summary> and C<list> commands. Most can be
+combined. See each individual filter for details.
+
+=over
+
+=item --status=STATUS
+
+You can choose any of the Statuses which might appear in your issues. This
+status does not have to be defined in your C<.cil> file, even if you have
+C<StatusStrict> turned on.
+
+=item --label=LABEL
+
+You can choose any of the Labels which might appear in your issues. This
+label does not have to be defined in your C<.cil> file, even if you have
+C<LabelStrict> turned on.
+
+=item --is-open, --is-closed
+
+These check both C<StatusOpenList> and C<StatusClosedList> from your C<.cil>
+file. If both are specified, you're likely to get no issues unless you
+explicitely defined a status as being in both lists (for whatever reason you
+have).
+
+=item --assigned-to=EMAIL_ADDRESS, --is-mine
+
+These items are mutually exclusive. The C<--assigned-to> just checks the email
+address in the AssignedTo field. It does not match anything else in that field,
+including any preceding name or any angle brackets.
+
+The C<--is-mine> filter is a shortcut to asking if AssignedTo is you. Cil knows
+your email address if you define it in your user's C<~/.cilrc> file as
+C<UserEmail>.
+
+=back
+
=head1 .cil
The C<.cil> file is used to configure bits and pieces within cil for this