[Bps-public-commit] SD branch, master, updated. f983de65a7514296782e1a343ac072f03e9ad285

jesse jesse at bestpractical.com
Tue Jun 9 11:18:28 EDT 2009


The branch, master has been updated
       via  f983de65a7514296782e1a343ac072f03e9ad285 (commit)
      from  1dcc7f59764a7c79f2e01002776b5af0476ba23a (commit)

Summary of changes:
 lib/App/SD/CLI/Dispatcher.pm |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit f983de65a7514296782e1a343ac072f03e9ad285
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Jun 9 11:09:08 2009 -0400

    Enabled --help; fixes 9592E26A-312E-11DE-8D86-C8FBC71F1893

diff --git a/lib/App/SD/CLI/Dispatcher.pm b/lib/App/SD/CLI/Dispatcher.pm
index 1b98ccd..49671a9 100644
--- a/lib/App/SD/CLI/Dispatcher.pm
+++ b/lib/App/SD/CLI/Dispatcher.pm
@@ -11,6 +11,16 @@ rewrite qr/^\?(.*)/ => sub { "help ".($1||'') };
 # 'sd about' -> 'sd help about', 'sd copying' -> 'sd help copying'
 rewrite [ ['about', 'copying'] ] => sub { "help $1" };
 
+on qr'^(?!help)' => sub {
+    my $self = shift;
+    my $cmd = $_; 
+    if ($self->context->has_arg('help')) {
+        run("help $cmd", $self, @_);
+    } else { 
+        next_rule;
+        }
+
+};
 
 under help => sub {
     on [ [ 'intro', 'init', 'clone' ] ]   => run_command('Help::Intro');

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



More information about the Bps-public-commit mailing list