[Bps-public-commit] r15694 - in sd/trunk: .
sartak at bestpractical.com
sartak at bestpractical.com
Tue Sep 2 13:54:07 EDT 2008
Author: sartak
Date: Tue Sep 2 13:54:05 2008
New Revision: 15694
Modified:
sd/trunk/ (props changed)
sd/trunk/lib/App/SD/CLI/Dispatcher.pm
Log:
r70855 at onn: sartak | 2008-09-02 13:53:57 -0400
We need to dispatch on the current path AND the original path
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 Tue Sep 2 13:54:05 2008
@@ -12,17 +12,21 @@
on qr{.} => sub {
my %args = @_;
-
- my @pieces = __PACKAGE__->resolve_builtin_aliases(@{ $args{dispatching_on} });
+ my $cli = $args{cli};
my @possible_classes;
- while (@pieces) {
- push @possible_classes, "App::SD::CLI::Command::"
- . join '::', @pieces;
- shift @pieces;
- }
- my $cli = $args{cli};
+ # we want to dispatch on the original command "ticket attachment create"
+ # AND on the command we received "create"
+ for ([@{ $args{dispatching_on} }], [split ' ', $_]) {
+ my @pieces = __PACKAGE__->resolve_builtin_aliases(@$_);
+
+ while (@pieces) {
+ push @possible_classes, "App::SD::CLI::Command::"
+ . join '::', @pieces;
+ shift @pieces;
+ }
+ }
for my $class (@possible_classes) {
if ($cli->_try_to_load_cmd_class($class)) {
More information about the Bps-public-commit
mailing list