[Bps-public-commit] r15491 - in Prophet/branches/dispatcher: lib/Prophet lib/Prophet/CLI
sartak at bestpractical.com
sartak at bestpractical.com
Tue Aug 26 11:54:01 EDT 2008
Author: sartak
Date: Tue Aug 26 11:53:59 2008
New Revision: 15491
Modified:
Prophet/branches/dispatcher/ (props changed)
Prophet/branches/dispatcher/lib/Prophet/CLI.pm
Prophet/branches/dispatcher/lib/Prophet/CLI/Dispatcher.pm
Log:
r70388 at onn: sartak | 2008-08-26 11:53:46 -0400
Re-add the default command
Modified: Prophet/branches/dispatcher/lib/Prophet/CLI.pm
==============================================================================
--- Prophet/branches/dispatcher/lib/Prophet/CLI.pm (original)
+++ Prophet/branches/dispatcher/lib/Prophet/CLI.pm Tue Aug 26 11:53:59 2008
@@ -115,15 +115,6 @@
return $class->new(%constructor_args);
}
-=head2 _default_command
-
-Returns the "default" command for use when no arguments were specified on the
-command line. In Prophet, it's "shell" but your subclass can change that.
-
-=cut
-
-sub _default_command { "shell" }
-
sub _try_to_load_cmd_class {
my $self = shift;
my $class = shift;
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 Tue Aug 26 11:53:59 2008
@@ -28,6 +28,11 @@
}
};
+on qr{^\s*$} => sub {
+ run(__PACKAGE__->default_command, @_);
+
+};
+
my %CMD_MAP = (
ls => 'search',
new => 'create',
@@ -49,5 +54,14 @@
return wantarray ? @cmds : $cmds[-1];
}
+=head2 default_command
+
+Returns the "default" command for use when no arguments were specified on the
+command line. In Prophet, it's "shell" but your subclass can change that.
+
+=cut
+
+sub default_command { "shell" }
+
1;
More information about the Bps-public-commit
mailing list