[Bps-public-commit] r12225 - in Prophet/trunk: .
sartak at bestpractical.com
sartak at bestpractical.com
Sat May 10 23:03:49 EDT 2008
Author: sartak
Date: Sat May 10 23:03:48 2008
New Revision: 12225
Modified:
Prophet/trunk/ (props changed)
Prophet/trunk/lib/Prophet/CLI.pm
Log:
r55540 at onn: sartak | 2008-05-10 22:56:22 -0400
Update->edit_record which uses edit_hash(record->props) if --edit is specified
Modified: Prophet/trunk/lib/Prophet/CLI.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI.pm (original)
+++ Prophet/trunk/lib/Prophet/CLI.pm Sat May 10 23:03:48 2008
@@ -345,12 +345,25 @@
package Prophet::CLI::Command::Update;
use base qw/Prophet::CLI::Command/;
+sub edit_record {
+ my $self = shift;
+ my $record = shift;
+
+ if (exists $self->args->{edit}) {
+ my $props = $record->get_props;
+ return $self->edit_hash($props);
+ }
+ else {
+ return $self->args;
+ }
+}
+
sub run {
my $self = shift;
my $record = $self->_get_record;
$record->load( uuid => $self->uuid );
- my $result = $record->set_props( props => $self->edit_args );
+ my $result = $record->set_props( props => $self->edit_record($record) );
if ($result) {
print $record->type . " " . $record->uuid . " updated.\n";
More information about the Bps-public-commit
mailing list