[Bps-public-commit] r16849 - sd/trunk/lib/App/SD/CLI
jesse at bestpractical.com
jesse at bestpractical.com
Sat Nov 15 20:45:30 EST 2008
Author: jesse
Date: Sat Nov 15 20:45:30 2008
New Revision: 16849
Modified:
sd/trunk/lib/App/SD/CLI/Dispatcher.pm
Log:
* snapshot
Modified: sd/trunk/lib/App/SD/CLI/Dispatcher.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Dispatcher.pm (original)
+++ sd/trunk/lib/App/SD/CLI/Dispatcher.pm Sat Nov 15 20:45:30 2008
@@ -3,13 +3,15 @@
use Prophet::CLI::Dispatcher -base;
use Moose;
+Prophet::CLI::Dispatcher->add_command_prefix('App::SD::CLI::Command');
+
# "sd ?about" => "sd help about"
rewrite qr/^\?(.*)/ => sub { "help $1" };
# 'sd about' -> 'sd help about', 'sd copying' -> 'sd help copying'
rewrite [ ['about', 'copying'] ] => sub { "help $1" };
-on undef => run_command('Shell');
+#on '' => run_command('Shell');
under help => sub {
on about => run_command('Help::About');
@@ -82,20 +84,12 @@
run($2, $self, @_);
};
-__PACKAGE__->dispatcher->add_rule(
- Path::Dispatcher::Rule::Dispatch->new(
- dispatcher => Prophet::CLI::Dispatcher->dispatcher,
- ),
-);
-
-sub run_command { Prophet::CLI::Dispatcher::run_command(@_) }
+warn "Going to redisp";
+redispatch_to('Prophet::CLI::Dispatcher');
+warn "Done redisp";
-sub class_names {
- my $self = shift;
- my $name = shift;
+sub run_command {Prophet::CLI::Dispatcher::run_command(@_) }
- ("App::SD::CLI::Command::$name", $self->SUPER::class_names($name, @_));
-}
__PACKAGE__->meta->make_immutable;
no Moose;
More information about the Bps-public-commit
mailing list