[Bps-public-commit] r15784 - in sd/trunk: bin lib/App/SD/CLI

jesse at bestpractical.com jesse at bestpractical.com
Sun Sep 7 16:58:54 EDT 2008


Author: jesse
Date: Sun Sep  7 16:58:54 2008
New Revision: 15784

Modified:
   sd/trunk/bin/sd
   sd/trunk/lib/App/SD/CLI/Command/Shell.pm
   sd/trunk/lib/App/SD/CLI/Dispatcher.pm

Log:
* Added support for ? and 'copying' commands in the shell


Modified: sd/trunk/bin/sd
==============================================================================
--- sd/trunk/bin/sd	(original)
+++ sd/trunk/bin/sd	Sun Sep  7 16:58:54 2008
@@ -19,5 +19,5 @@
 }
 
 my $cli = App::SD::CLI->new;
-$cli->run_one_command;
+$cli->run_one_command(@ARGV);
 

Modified: sd/trunk/lib/App/SD/CLI/Command/Shell.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Shell.pm	(original)
+++ sd/trunk/lib/App/SD/CLI/Command/Shell.pm	Sun Sep  7 16:58:54 2008
@@ -5,7 +5,7 @@
 sub preamble {
     return join "\n",
         "SD ($App::SD::VERSION; Prophet $Prophet::VERSION)",
-        'Type "help", "about", or "copying for more information.',
+        'Type "help", "about", or "copying" for more information.',
 }
 
 1;

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	Sun Sep  7 16:58:54 2008
@@ -4,6 +4,10 @@
 use warnings;
 use Prophet::CLI::Dispatcher -base;
 
+
+on qr'^\?(.*)$' => sub {my $cmd = $1 || '';  run ('help'. $cmd,  @_); last_rule;};
+on qr'^(about|copying)$' => sub { run('help '.$1, @_); last_rule;};                     
+
 on qr{^(ticket|comment|attachment) \s+ (.*)}xi => sub {
     my %args = @_;
     $args{context}->set_arg(type => $1);



More information about the Bps-public-commit mailing list