From 3685d889e76e39663e59346e1aca0f041e30f4da Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Jan 2007 01:04:39 +0100 Subject: [PATCH] mysql_explain_log.sh: Patch from Paul DuBois for better help messages scripts/mysql_explain_log.sh: Patch from Paul DuBois for better help messages --- scripts/mysql_explain_log.sh | 106 ++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 51 deletions(-) diff --git a/scripts/mysql_explain_log.sh b/scripts/mysql_explain_log.sh index ad23a42451f..a549817db5a 100644 --- a/scripts/mysql_explain_log.sh +++ b/scripts/mysql_explain_log.sh @@ -21,9 +21,6 @@ use DBI; use Getopt::Long; $Getopt::Long::ignorecase=0; -print "explain_log provided by http://www.mobile.de\n"; -print "=========== ================================\n"; - my $Param={}; $Param->{host}=''; @@ -32,16 +29,28 @@ $Param->{password}=''; $Param->{PrintError}=0; $Param->{socket}=''; -if (!GetOptions ('date|d:i' => \$Param->{ViewDate}, +my $help; + +if (!GetOptions ( + 'date|d:i' => \$Param->{ViewDate}, 'host|h:s' => \$Param->{host}, 'user|u:s' => \$Param->{user}, 'password|p:s' => \$Param->{password}, 'printerror|e:s' => \$Param->{PrintError}, 'socket|s:s' => \$Param->{socket}, + 'help|h' => \$help, )) { ShowOptions(); + exit(0); } -else { +if (defined ($help)) { + ShowOptions(); + exit(0); +} + + print "explain_log provided by http://www.mobile.de\n"; + print "=========== ================================\n"; + $Param->{UpdateCount} = 0; $Param->{SelectCount} = 0; $Param->{IdxUseCount} = 0; @@ -245,7 +254,6 @@ else { print "Finished: \t".localtime(time)."\n"; } -} ########################################################################### @@ -323,21 +331,26 @@ sub ShowOptions { print <