[Bps-public-commit] r16074 - in Prophet/branches/dispatcher: lib/Prophet/CLI

sartak at bestpractical.com sartak at bestpractical.com
Thu Sep 25 16:45:00 EDT 2008


Author: sartak
Date: Thu Sep 25 16:44:59 2008
New Revision: 16074

Modified:
   Prophet/branches/dispatcher/   (props changed)
   Prophet/branches/dispatcher/lib/Prophet/CLI/Dispatcher.pm

Log:
 r72485 at onn:  sartak | 2008-09-25 16:43:52 -0400
 update command


Modified: Prophet/branches/dispatcher/lib/Prophet/CLI/Dispatcher.pm
==============================================================================
--- Prophet/branches/dispatcher/lib/Prophet/CLI/Dispatcher.pm	(original)
+++ Prophet/branches/dispatcher/lib/Prophet/CLI/Dispatcher.pm	Thu Sep 25 16:44:59 2008
@@ -81,6 +81,27 @@
 
 };
 
+on ['update'] => sub {
+    my $self = shift;
+
+    $self->context->require_uuid;
+    my $record = $self->context->_load_record;
+
+    my $new_props = $self->cli->edit_record($record);
+    my $updated = $record->set_props( props => $new_props );
+
+    if ($updated) {
+        print $record->type . " " . $record->luid . " (".$record->uuid.")"." updated.\n";
+
+    } else {
+        print "SOMETHING BAD HAPPENED "
+            . $record->type . " "
+            . $record->luid . " ("
+            . $record->uuid
+            . ") not updated.\n";
+    }
+};
+
 on qr/()/ => sub {
     my $self = shift;
     $self->fatal_error("The command you ran could not be found. Perhaps running '$0 help' would help?");



More information about the Bps-public-commit mailing list