Merge lp:~percona-toolkit-dev/percona-toolkit/fix-831525-pqd-mangled-help into lp:percona-toolkit/2.1

Proposed by Brian Fraser
Status: Merged
Approved by: Daniel Nichter
Approved revision: 451
Merged at revision: 469
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/fix-831525-pqd-mangled-help
Merge into: lp:percona-toolkit/2.1
Diff against target: 65 lines (+21/-5)
3 files modified
bin/pt-query-digest (+1/-1)
lib/OptionParser.pm (+1/-1)
t/pt-query-digest/option_sanity.t (+19/-3)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/fix-831525-pqd-mangled-help
Reviewer Review Type Date Requested Status
Daniel Nichter Approve
Review via email: mp+134588@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Daniel Nichter (daniel-nichter) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/pt-query-digest'
2--- bin/pt-query-digest 2012-11-13 15:22:01 +0000
3+++ bin/pt-query-digest 2012-11-16 01:10:29 +0000
4@@ -1373,7 +1373,7 @@
5 $desc .= ". Optional suffix s=seconds, m=minutes, h=hours, "
6 . "d=days; if no suffix, $s is used.";
7 }
8- $desc = join("\n$rpad", grep { $_ } $desc =~ m/(.{0,$rcol})(?:\s+|$)/g);
9+ $desc = join("\n$rpad", grep { $_ } $desc =~ m/(.{0,$rcol}(?!\W))(?:\s+|(?<=\W)|$)/g);
10 $desc =~ s/ +$//mg;
11 if ( $short ) {
12 $usage .= sprintf(" --%-${maxs}s -%s %s\n", $long, $short, $desc);
13
14=== modified file 'lib/OptionParser.pm'
15--- lib/OptionParser.pm 2012-10-30 15:42:42 +0000
16+++ lib/OptionParser.pm 2012-11-16 01:10:29 +0000
17@@ -1074,7 +1074,7 @@
18 . "d=days; if no suffix, $s is used.";
19 }
20 # Wrap long descriptions
21- $desc = join("\n$rpad", grep { $_ } $desc =~ m/(.{0,$rcol})(?:\s+|$)/g);
22+ $desc = join("\n$rpad", grep { $_ } $desc =~ m/(.{0,$rcol}(?!\W))(?:\s+|(?<=\W)|$)/g);
23 $desc =~ s/ +$//mg;
24 if ( $short ) {
25 $usage .= sprintf(" --%-${maxs}s -%s %s\n", $long, $short, $desc);
26
27=== modified file 't/pt-query-digest/option_sanity.t'
28--- t/pt-query-digest/option_sanity.t 2012-05-30 17:14:13 +0000
29+++ t/pt-query-digest/option_sanity.t 2012-11-16 01:10:29 +0000
30@@ -9,7 +9,7 @@
31 use strict;
32 use warnings FATAL => 'all';
33 use English qw(-no_match_vars);
34-use Test::More tests => 6;
35+use Test::More;
36
37 use PerconaTest;
38
39@@ -57,8 +57,24 @@
40 like $output,
41 qr/\Q--embedded-attributes POSIX syntax [: :] belongs inside character/,
42 "Bug 885382: --embedded-attributes rejects warning patterns early";;
43-
44+
45+# #############################################################################
46+# pt-query-digest help output mangled
47+# https://bugs.launchpad.net/percona-toolkit/+bug/831525
48+# #############################################################################
49+
50+$output = `$trunk/bin/pt-query-digest --help`;
51+
52+like(
53+ $output,
54+ qr/\Q--report-format=A\E\s*
55+ \QPrint these sections of the query analysis\E\s*
56+ \Qreport (default rusage,date,hostname,files,\E\s*
57+ \Qheader,profile,query_report,prepared)\E/x,
58+ "Bug 831525: pt-query-digest help output mangled"
59+);
60+
61 # #############################################################################
62 # Done.
63 # #############################################################################
64-exit;
65+done_testing;

Subscribers

People subscribed via source and target branches