Skip to content

Commit

Permalink
Remove use of |fmt since this breaks code samples like
Browse files Browse the repository at this point in the history
    chomp($string);
    $string.chomp;

by putting them on one line when p6doc is used.

In any case we should be extending code in Pod::To::Text
to format pod (and there is a text wrap sub there).
  • Loading branch information
stmuk committed Jan 14, 2016
1 parent a5955cc commit 16af427
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions bin/p6doc
Expand Up @@ -55,8 +55,6 @@ sub locate-module(Str $modulename) {
sub show-docs(Str $path, :$section, :$no-pager) {
my $pager;
$pager = %*ENV<PAGER> // ($*DISTRO.is-win ?? 'more' !! 'less') unless $no-pager;
my $which-fmt = qq:x{which fmt}.chomp;
my $fmt-string = $which-fmt.IO.e ?? "| $which-fmt -w 80 " !! "";
if not open($path).lines.grep( /^'=' | '#|' | '#='/ ) {
say "No Pod found in $path";
return;
Expand All @@ -69,7 +67,7 @@ sub show-docs(Str $path, :$section, :$no-pager) {
} else {
$doc-command-str ~= " --doc"
}
$doc-command-str ~= " $path $fmt-string";
$doc-command-str ~= " $path ";
$doc-command-str ~= " | $pager" if $pager;
say "launching '$doc-command-str'" if DEBUG;
shell $doc-command-str;
Expand Down

0 comments on commit 16af427

Please sign in to comment.