Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add simple word-wrap on searched descriptions

  • Loading branch information...
commit c57f79b1f2732219976b5d9af6014fa346fffb0f 1 parent 88c01da
@perlpilot authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 bin/panda
View
6 bin/panda
@@ -27,11 +27,15 @@ sub listprojects($panda) {
}
}
+sub wrap ($str) {
+ return $str.comb(/ . ** 0..40 [ << | $ ]/).grep({ .chars > 0 }).join("\n" ~ " " x 36);
+}
+
sub search-projects($panda, $string) {
for $panda.ecosystem.project-list -> $project {
my $p = $panda.ecosystem.get-project($project);
next unless $p.name ~~ / <$string> / || $p.metainfo<description> ~~ / <$string> /;
- printf "%-24s %-10s %s\n",$p.name,$p.version, $p.metainfo<description>;
+ printf "%-24s %-10s %s\n",$p.name,$p.version, wrap($p.metainfo<description>);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.