[Bps-public-commit] SD branch, master, updated. 0.70-45-g4769f5a

spang at bestpractical.com spang at bestpractical.com
Fri Sep 4 13:12:45 EDT 2009


The branch, master has been updated
       via  4769f5aef694ead6018e328ba48e24b2606be132 (commit)
      from  b3af3f07bce9a058fce3ceba4c2f3f8a0500f9ad (commit)

Summary of changes:
 lib/App/SD/CLI/Dispatcher.pm |    5 +++--
 t/sd-dispatcher.t            |    4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 4769f5aef694ead6018e328ba48e24b2606be132
Author: Christine Spang <spang at bestpractical.com>
Date:   Fri Sep 4 13:00:05 2009 -0400

    Hey, there's a version command. Use that instead of making stuff up in the dispatcher.

diff --git a/lib/App/SD/CLI/Dispatcher.pm b/lib/App/SD/CLI/Dispatcher.pm
index ad620af..b063feb 100644
--- a/lib/App/SD/CLI/Dispatcher.pm
+++ b/lib/App/SD/CLI/Dispatcher.pm
@@ -22,8 +22,9 @@ on qr'^(?!help)' => sub {
     }
     elsif ($self->context->has_arg('version')
             || $self->context->has_arg('V') ) {
-        print "SD $App::SD::VERSION\n";
-        exit 0;
+        $self->context->delete_arg('version');
+        $self->context->delete_arg('V');
+        run("version", $self);
     }
     else {
         next_rule;
diff --git a/t/sd-dispatcher.t b/t/sd-dispatcher.t
index afe3237..7793afd 100644
--- a/t/sd-dispatcher.t
+++ b/t/sd-dispatcher.t
@@ -212,6 +212,6 @@ run_output_matches( 'sd', [ 'ticket', 'give', 'spang at bestpractical.com' ],
 
 require App::SD;
 run_output_matches( 'sd', [ '-V' ],
-    [ "SD $App::SD::VERSION" ], 'version short' );
+    [ "sd $App::SD::VERSION" ], 'version short' );
 run_output_matches( 'sd', [ '--version' ],
-    [ "SD $App::SD::VERSION" ], 'version long' );
+    [ "sd $App::SD::VERSION" ], 'version long' );

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list