'is-closed', # for 'summary', 'list'
'is-mine', # for 'summary', 'list'
'mine', # for 'add'
+ 'batch', # for 'am'
'help',
'version',
);
'is-closed' => 1,
'is-mine' => 1,
'mine' => 1,
+ 'batch' => 1,
);
## ----------------------------------------------------------------------------
comment ISSUE
attach ISSUE FILENAME
extract ATTACHMENT [--filename=FILENAME]
- am EMAIL.TXT
+ am EMAIL.TXT [--batch]
track ISSUE
fsck
sub name { 'am' }
sub run {
- my ($self, $cil, undef, $email_filename, $noquestions) = @_;
-
- $noquestions = 0 unless $noquestions eq 'yes';
+ my ($self, $cil, $args, $email_filename) = @_;
unless ( -r $email_filename ) {
CIL::Utils::fatal("couldn't load email '$email_filename'");
$issue = (values %issue)[0];
}
else {
- if ($noquestions) {
- CIL::Utils->fatal('Cannot add to an existing message when there are multiple options, in noninteractive mode!');
+ if ( $args->{batch} ) {
+ CIL::Utils->fatal('Cannot add to an existing message (in batch mode) when there are multiple matched messages!');
}
my $ans = CIL::Utils::ans('To which issue would you like to add this comment: ');
# then ask if the user would like to add it
CIL::Utils->msg("Couldn't find any likely issues, so this might be a new one.");
- if ($noquestions) {
- CIL::Utils->msg('Running in non interactive mode, so just adding it as a new one without asking"!');
+ if ( $args->{batch} ) {
+ CIL::Utils->msg('Running in batch mode, so just adding mail as a new issue');
} else {
my $ans = CIL::Utils::ans('Would you like to add this message as an issue shown above (y/n): ');
return unless $ans eq 'y';