mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 13:40:07 +00:00
Merged fix-831525-pqd-mangled-help
This commit is contained in:
@@ -1373,7 +1373,7 @@ sub print_usage {
|
||||
$desc .= ". Optional suffix s=seconds, m=minutes, h=hours, "
|
||||
. "d=days; if no suffix, $s is used.";
|
||||
}
|
||||
$desc = join("\n$rpad", grep { $_ } $desc =~ m/(.{0,$rcol})(?:\s+|$)/g);
|
||||
$desc = join("\n$rpad", grep { $_ } $desc =~ m/(.{0,$rcol}(?!\W))(?:\s+|(?<=\W)|$)/g);
|
||||
$desc =~ s/ +$//mg;
|
||||
if ( $short ) {
|
||||
$usage .= sprintf(" --%-${maxs}s -%s %s\n", $long, $short, $desc);
|
||||
|
@@ -1074,7 +1074,7 @@ sub print_usage {
|
||||
. "d=days; if no suffix, $s is used.";
|
||||
}
|
||||
# Wrap long descriptions
|
||||
$desc = join("\n$rpad", grep { $_ } $desc =~ m/(.{0,$rcol})(?:\s+|$)/g);
|
||||
$desc = join("\n$rpad", grep { $_ } $desc =~ m/(.{0,$rcol}(?!\W))(?:\s+|(?<=\W)|$)/g);
|
||||
$desc =~ s/ +$//mg;
|
||||
if ( $short ) {
|
||||
$usage .= sprintf(" --%-${maxs}s -%s %s\n", $long, $short, $desc);
|
||||
|
@@ -9,7 +9,7 @@ BEGIN {
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use Test::More tests => 6;
|
||||
use Test::More;
|
||||
|
||||
use PerconaTest;
|
||||
|
||||
@@ -58,7 +58,23 @@ like $output,
|
||||
qr/\Q--embedded-attributes POSIX syntax [: :] belongs inside character/,
|
||||
"Bug 885382: --embedded-attributes rejects warning patterns early";;
|
||||
|
||||
# #############################################################################
|
||||
# pt-query-digest help output mangled
|
||||
# https://bugs.launchpad.net/percona-toolkit/+bug/831525
|
||||
# #############################################################################
|
||||
|
||||
$output = `$trunk/bin/pt-query-digest --help`;
|
||||
|
||||
like(
|
||||
$output,
|
||||
qr/\Q--report-format=A\E\s*
|
||||
\QPrint these sections of the query analysis\E\s*
|
||||
\Qreport (default rusage,date,hostname,files,\E\s*
|
||||
\Qheader,profile,query_report,prepared)\E/x,
|
||||
"Bug 831525: pt-query-digest help output mangled"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
exit;
|
||||
done_testing;
|
||||
|
Reference in New Issue
Block a user