mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 13:11:32 +00:00
Merge lp:~percona-toolkit-dev/percona-toolkit/check-for-option-typos.
This commit is contained in:
@@ -4085,7 +4085,7 @@ Print DROP KEY statement for each duplicate key. By default an ALTER TABLE
|
||||
DROP KEY statement is printed below each duplicate key so that, if you want to
|
||||
remove the duplicate key, you can copy-paste the statement into MySQL.
|
||||
|
||||
To disable printing these statements, specify --nosql.
|
||||
To disable printing these statements, specify C<--no-sql>.
|
||||
|
||||
=item --[no]summary
|
||||
|
||||
|
@@ -3066,7 +3066,7 @@ L<"--base-dir">. These session files are played with L<"--play">.
|
||||
pt-log-player will L<"--play"> session files in parallel using N number of
|
||||
L<"--threads">. (They're not technically threads, but we call them that
|
||||
anyway.) Each thread will play all the sessions in its given session files.
|
||||
The sessions are played as fast as possible--there are no delays--because the
|
||||
The sessions are played as fast as possible (there are no delays) because the
|
||||
goal is to stress-test and load-test the server. So be careful using this
|
||||
script on a production server!
|
||||
|
||||
|
@@ -14530,7 +14530,7 @@ and see also L<"FINGERPRINTS">.
|
||||
|
||||
A report is printed for each L<"--group-by"> value (unless C<--no-report> is
|
||||
given). Therefore, C<--group-by user,db> means "report on queries with the
|
||||
same user and report on queries with the same db"--it does not mean "report
|
||||
same user and report on queries with the same db"; it does not mean "report
|
||||
on queries with the same user and db." See also L<"OUTPUT">.
|
||||
|
||||
Every value must have a corresponding value in the same position in
|
||||
@@ -15236,7 +15236,7 @@ The MySQL time expression is wrapped inside a query like
|
||||
valid inside this query. For example, do not use UNIX_TIMESTAMP() because
|
||||
UNIX_TIMESTAMP(UNIX_TIMESTAMP()) returns 0.
|
||||
|
||||
Events are assumed to be in chronological--older events at the beginning of
|
||||
Events are assumed to be in chronological: older events at the beginning of
|
||||
the log and newer events at the end of the log. L<"--since"> is strict: it
|
||||
ignores all queries until one is found that is new enough. Therefore, if
|
||||
the query events are not consistently timestamped, some may be ignored which
|
||||
|
@@ -1477,7 +1477,7 @@ L<"--variable"> column matches the L<"--match"> option. For example, to trigger
|
||||
when more than 10 processes are in the "statistics" state, use the following
|
||||
options:
|
||||
|
||||
--trigger processlist --variable State \
|
||||
--function processlist --variable State \
|
||||
--match statistics --threshold 10
|
||||
|
||||
=back
|
||||
|
@@ -23,11 +23,12 @@ my $tool_type; # perl or bash
|
||||
my @check_subs = (qw(
|
||||
check_alpha_order
|
||||
check_module_usage
|
||||
check_option_types
|
||||
check_pod_header_order
|
||||
check_pod_formatting
|
||||
check_option_usage
|
||||
check_pod_links
|
||||
check_option_usage
|
||||
check_option_types
|
||||
check_option_typos
|
||||
));
|
||||
|
||||
TOOL:
|
||||
@@ -471,6 +472,22 @@ sub check_option_usage {
|
||||
return;
|
||||
}
|
||||
|
||||
sub check_option_typos {
|
||||
my ($fh) = @_;
|
||||
|
||||
my %ops = map { $_=>1 } split /\n/, `awk '/^=item --/ {print \$2}' $tool_file`;
|
||||
my $len = `wc -l $tool_file`;
|
||||
my $doc = `grep '^=pod' -A $len`;
|
||||
while ( $doc =~ m/(--[a-z]+[a-z-]+)/sg ) {
|
||||
my $op = $1;
|
||||
my $nop = $op;
|
||||
$nop =~ s/^--no-/--[no]/;
|
||||
if ( !$ops{$op} && !$ops{$nop} ) {
|
||||
print "Unknown option in documentation: $op\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub check_pod_links {
|
||||
my $offset = `cat $tool_file | grep '^=head1 NAME' --byte-offset | cut -d ':' -f 1`;
|
||||
if ( !$offset ) {
|
||||
|
Reference in New Issue
Block a user