[Bps-public-commit] r15827 - in App-CLI/trunk: lib/App/CLI/Command

clkao at bestpractical.com clkao at bestpractical.com
Mon Sep 8 07:16:25 EDT 2008


Author: clkao
Date: Mon Sep  8 07:16:25 2008
New Revision: 15827

Modified:
   App-CLI/trunk/   (props changed)
   App-CLI/trunk/lib/App/CLI/Command/Help.pm

Log:
 r409 at mtl:  clkao | 2008-05-07 18:38:03 +0800
 patches from charsbar:
 - $self->app is not reference;
 - used Pod::Simple::Text; extract brief description correctly
 


Modified: App-CLI/trunk/lib/App/CLI/Command/Help.pm
==============================================================================
--- App-CLI/trunk/lib/App/CLI/Command/Help.pm	(original)
+++ App-CLI/trunk/lib/App/CLI/Command/Help.pm	Mon Sep  8 07:16:25 2008
@@ -4,6 +4,7 @@
 use base qw/App::CLI::Command/;
 use File::Find qw(find);
 use Locale::Maketext::Simple;
+use Pod::Simple::Text;
 
 sub run {
     my $self = shift;
@@ -20,12 +21,13 @@
         }
         elsif (my $file = $self->_find_topic($topic)) {
             open my $fh, '<:utf8', $file or die $!;
+            require Pod::Simple::Text;
             my $parser = Pod::Simple::Text->new;
             my $buf;
             $parser->output_string(\$buf);
             $parser->parse_file($fh);
 
-            $buf =~ s/^NAME\s+(.*?)::Help::\S+ - (.+)\s+DESCRIPTION/    $1:/;
+            $buf =~ s/^NAME\s+(.*?)::Help::\S+ - (.+)\s+DESCRIPTION/    $2:/;
             print $self->loc_text($buf);
         }
         else {
@@ -37,7 +39,7 @@
 
 sub help_base {
     my $self = shift;
-    return ref($self->app)."::Help";
+    return $self->app."::Help";
 }
 
 my ($inc, @prefix);



More information about the Bps-public-commit mailing list