[Bps-public-commit] r14708 - in Prophet/trunk: .

spang at bestpractical.com spang at bestpractical.com
Fri Aug 1 11:14:04 EDT 2008


Author: spang
Date: Fri Aug  1 11:14:02 2008
New Revision: 14708

Modified:
   Prophet/trunk/   (props changed)
   Prophet/trunk/lib/Prophet/CLI.pm

Log:
 r47500 at loki:  spang | 2008-08-01 16:12:01 +0100
 fixes to run_another_command and rename it to change_attributes


Modified: Prophet/trunk/lib/Prophet/CLI.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI.pm	(original)
+++ Prophet/trunk/lib/Prophet/CLI.pm	Fri Aug  1 11:14:02 2008
@@ -339,10 +339,10 @@
     }
 }
 
-=head2 run_another_command ( args => $hashref, props => $arrayref, type => 'str' )
+=head2 change_attributes ( args => $hashref, props => $arrayref, type => 'str' )
 
-A hook for running a second command from within a command without having
-to use the commandline argument parsing.
+A hook for modifying attributes to prepare for running other commands from
+within a command.
 
 C<props> should be an array reference of hashes containing the keys C<prop>,
 C<cmp>, and C<value>, such as what is expected by the C<prop_set> attribute
@@ -355,7 +355,7 @@
 
 =cut
 
-sub run_another_command {
+sub change_attributes {
     my $self = shift;
     my %args = @_;
 
@@ -381,13 +381,9 @@
     if (my $type = $args{type}) {
         $self->type($type);
     }
-
     if (my $primary_commands = $args{primary_commands}) {
         $self->primary_commands($primary_commands);
     }
-    if ( my $cmd_obj = $self->_get_cmd_obj() ) {
-        $cmd_obj->run();
-    }
 }
 
 =head2 clear_args
@@ -399,7 +395,7 @@
 sub clear_args {
     my $self = shift;
 
-    foreach my $arg (keys %{$self->args}) {
+    foreach my $arg ($self->arg_names) {
         $self->delete_arg($arg);
     }
 }
@@ -413,7 +409,7 @@
 sub clear_props {
     my $self = shift;
 
-    foreach my $prop (keys %{$self->props}) {
+    foreach my $prop ($self->prop_names) {
         $self->delete_prop($prop);
     }
     $self->prop_set( ( ) );



More information about the Bps-public-commit mailing list