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

sartak at bestpractical.com sartak at bestpractical.com
Wed Aug 6 14:01:08 EDT 2008


Author: sartak
Date: Wed Aug  6 14:01:06 2008
New Revision: 14860

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

Log:
 r68886 at onn:  sartak | 2008-08-06 14:00:30 -0400
 Turn dispatcher into a method that can be overridden


Modified: Prophet/branches/dispatcher/lib/Prophet/CLI.pm
==============================================================================
--- Prophet/branches/dispatcher/lib/Prophet/CLI.pm	(original)
+++ Prophet/branches/dispatcher/lib/Prophet/CLI.pm	Wed Aug  6 14:01:06 2008
@@ -108,6 +108,15 @@
     display => 'show',
 );
 
+=head2 dispatcher -> Class
+
+Returns the dispatcher used to dispatch command lines. You'll want to override
+this in your subclass.
+
+=cut
+
+sub dispatcher { "Prophet::CLI::Dispatcher" }
+
 =head2 _get_cmd_obj
 
 Attempts to determine a command object based on aliases and the currently
@@ -130,7 +139,7 @@
         got_command => sub { $class = shift },
     );
 
-    Prophet::CLI::Dispatcher->run($command, $self, %dispatcher_args);
+    $self->dispatcher->run($command, $self, %dispatcher_args);
 
     die "I don't know how to parse '$command'. Are you sure that's a valid command?" unless $class;
 



More information about the Bps-public-commit mailing list