Permalink
Browse files

MANIFEST.SKIP: remove Makefile.PL. SubMgr.pm SubsubMgr.pm: bugs porti…

…ng Ruby code (# -> $) and use pod2text formatting.
  • Loading branch information...
1 parent f0a34e9 commit 47b3995408542918383a223f6d33008a209b3702 Rocky Bernstein committed Dec 12, 2012
View
@@ -27,6 +27,7 @@
# Avoid Module::Build generated and utility files.
\bBuild$
+\bMakefile.PL$
\b_build/
\bBuild.bat$
\bBuild.COM$
@@ -203,11 +203,11 @@ sub help($$)
my @subcmds = $self->list();
if ('*' eq $subcmd_name) {
- @help_text = (sprintf("List of subcommands for command '%s':",
+ @help_text = (sprintf("B<List of subcommands for command I<%s>:>",
$self->{name}));
my $subcmds = $self->columnize_commands(\@subcmds); chomp $subcmds;
push @help_text, $subcmds;
- return join("\n", @help_text);
+ return join("\n\n", @help_text);
}
# "help cmd subcmd". Give help specific for that subcommand.
@@ -220,19 +220,21 @@ sub help($$)
}
} else {
my $proc = $self->{proc};
- my @matches = sort(grep /^#\{$subcmd_name\}/, @subcmds);
+ my @matches = sort(grep /^$subcmd_name/, @subcmds);
my $name = $self->{name};
if (0 == scalar @matches) {
- $proc->errmsg("No ${name} subcommands found matching /^#{$subcmd_name}/. Try \"help\" $name.");
+ $proc->errmsg("No ${name} subcommands found matching /^{$subcmd_name}/. Try \"help $name *\".");
return undef;
} elsif (1 == scalar @matches) {
$args->[-1] = $matches[0];
$self->help($args);
} else {
- @help_text = ("Subcommands of \"$name\" matching /^#{$subcmd_name}/:");
+ # pod2text formatting used below. That's why B<>, I<> and
+ # \n\n for \n.
+ @help_text = ("B<Subcommands of I<$name> matching /^$subcmd_name/:>");
my @sort_matches = sort @matches;
- push @help_text, $self->{cmd}->columnize_commands(\@sort_matches);
- return @help_text;
+ push @help_text, $self->columnize_commands(\@sort_matches);
+ return join("\n\n", @help_text);
}
}
}
@@ -215,13 +215,14 @@ sub help($$)
my @subcmds = $self->list();
if ('*' eq $subcmd_name) {
- @help_text = (sprintf("List of subcommands for command '%s':",
+ @help_text = (sprintf("B<List of subcommands for command I<%s>:>",
$self->{cmd_str}));
my $subcmds = $self->{parent}->columnize_commands(\@subcmds);
chomp $subcmds;
push @help_text, $subcmds;
- return join("\n", @help_text);
+ # Double carriage return because of perlpod
+ return join("\n\n", @help_text);
}
# "help cmd subcmd". Give help specific for that subcommand.
@@ -234,16 +235,17 @@ sub help($$)
}
} else {
my $proc = $self->{proc};
- my @matches = sort(grep /^#{subcmd_name}/, @subcmds);
+ my @matches = sort(grep /^${subcmd_name}/, @subcmds);
my $name = $self->{cmd_str};
+ print "HI!\n";
if (0 == scalar @matches) {
- $proc->errmsg("No ${name} subcommands found matching /^#{$subcmd_name}/. Try \"help\" $name.");
+ $proc->errmsg("No ${name} subcommands found matching /^{$subcmd_name}/. Try \"help\" $name.");
return undef;
} elsif (1 == scalar @matches) {
$args->[-1] = $matches[0];
$self->help($args);
} else {
- @help_text = ("Subcommands of \"$name\" matching /^#{$subcmd_name}/:");
+ @help_text = ("Subcommands of \"$name\" matching /^${subcmd_name}/:");
my @sort_matches = sort @matches;
push @help_text, $self->{parent}{cmd}->columnize_commands(\@sort_matches);
return @help_text;
View
@@ -0,0 +1,15 @@
+#!/usr/bin/env perl
+use warnings; use strict;
+use rlib '.'; use Helper;
+
+my $opts = {
+ filter => sub{
+ my ($got_lines, $correct_lines) = @_;
+ return ($got_lines, $correct_lines);
+ },
+ run_opts => " --basename --no-highlight -nx --fall-off-end"
+};
+
+my $test_prog = prog_file('gcd.pl');
+run_debugger("$test_prog 3 5", cmd_file(), undef, $opts);
+done_testing();
View
@@ -0,0 +1,5 @@
+# See that finish on a breakpoint line reports a "return" event
+# not a breakpoint event. Line 21 the return location of gcd.
+help info ff
+help info f
+quit!
View
@@ -0,0 +1,8 @@
+-- main::(gcd.pl:18)
+die sprintf "Need two integer arguments, got %d", scalar(@ARGV) unless
+ @ARGV == 2;
+*** No info subcommands found matching /^{ff}/. Try "help info *".
+ Subcommands of *info* matching /^f/:
+
+ files frame functions
+trepan.pl: That's all, folks...

0 comments on commit 47b3995

Please sign in to comment.