[Bps-public-commit] r14127 - in sd/trunk: . lib/App/SD/CLI lib/App/SD/CLI/Command/Attachment
sartak at bestpractical.com
sartak at bestpractical.com
Tue Jul 15 16:24:23 EDT 2008
Author: sartak
Date: Tue Jul 15 16:24:09 2008
New Revision: 14127
Modified:
sd/trunk/ (props changed)
sd/trunk/lib/App/SD/CLI/Command.pm
sd/trunk/lib/App/SD/CLI/Command/Attachment/Create.pm
sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment/Create.pm
Log:
r64322 at onn: sartak | 2008-07-15 16:23:58 -0400
Default comment creation to pop up an editor instead of asking on stdin
Modified: sd/trunk/lib/App/SD/CLI/Command.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command.pm (original)
+++ sd/trunk/lib/App/SD/CLI/Command.pm Tue Jul 15 16:24:09 2008
@@ -4,7 +4,7 @@
sub get_content {
my $self = shift;
- my $type = shift;
+ my %args = @_;
my $content;
if (my $file = file($self->delete_arg('file'))) {
@@ -12,10 +12,10 @@
$self->set_prop(name => $file->basename);
} elsif ($content = $self->delete_arg('content')) {
- } elsif ($self->has_arg('edit')) {
+ } elsif ($args{default_edit} || $self->has_arg('edit')) {
$content = $self->edit_text('');
} else {
- print "Please type your $type and press ctrl-d.\n";
+ print "Please type your $args{type} and press ctrl-d.\n";
$content = do { local $/; <> };
}
Modified: sd/trunk/lib/App/SD/CLI/Command/Attachment/Create.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Attachment/Create.pm (original)
+++ sd/trunk/lib/App/SD/CLI/Command/Attachment/Create.pm Tue Jul 15 16:24:09 2008
@@ -6,7 +6,7 @@
before run => sub {
my $self = shift;
- $self->set_prop(content => $self->get_content('attachment'));
+ $self->set_prop(content => $self->get_content(type => 'attachment'));
};
__PACKAGE__->meta->make_immutable;
Modified: sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment/Create.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment/Create.pm (original)
+++ sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment/Create.pm Tue Jul 15 16:24:09 2008
@@ -9,7 +9,7 @@
before run => sub {
my $self = shift;
$self->set_prop(ticket => $self->cli->uuid);
- $self->set_prop(content => $self->get_content('comment'));
+ $self->set_prop(content => $self->get_content(type => 'comment', default_edit => 1));
};
__PACKAGE__->meta->make_immutable;
More information about the Bps-public-commit
mailing list