Commit d99fbf48 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MWL#55 : Add banner text to command line utilities

(Philip's review)
parent 3cb88652
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
#include <accctrl.h> #include <accctrl.h>
#include <aclapi.h> #include <aclapi.h>
#define USAGETEXT \
"mysql_install_db.exe Ver 1.42 for Windows\n" \
"This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n" \
"and you are welcome to modify and redistribute it under the GPL v2 license\n" \
"Usage: mysql_install_db.exe [OPTIONS]\n" \
"OPTIONS:"
extern "C" const char mysql_bootstrap_sql[]; extern "C" const char mysql_bootstrap_sql[];
...@@ -69,6 +75,7 @@ get_one_option(int optid, ...@@ -69,6 +75,7 @@ get_one_option(int optid,
DBUG_ENTER("get_one_option"); DBUG_ENTER("get_one_option");
switch (optid) { switch (optid) {
case '?': case '?':
printf("%s\n", USAGETEXT);
my_print_help(my_long_options); my_print_help(my_long_options);
exit(0); exit(0);
break; break;
......
...@@ -35,6 +35,13 @@ ...@@ -35,6 +35,13 @@
/* We're using version APIs */ /* We're using version APIs */
#pragma comment(lib, "version") #pragma comment(lib, "version")
#define USAGETEXT \
"mysql_upgrade_service.exe Ver 1.42 for Windows\n" \
"This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n" \
"and you are welcome to modify and redistribute it under the GPL v2 license\n" \
"Usage: mysql_upgrade_service.exe [OPTIONS]\n" \
"OPTIONS:"
static char mysqld_path[MAX_PATH]; static char mysqld_path[MAX_PATH];
static char mysqladmin_path[MAX_PATH]; static char mysqladmin_path[MAX_PATH];
static char mysqlupgrade_path[MAX_PATH]; static char mysqlupgrade_path[MAX_PATH];
...@@ -73,6 +80,7 @@ get_one_option(int optid, ...@@ -73,6 +80,7 @@ get_one_option(int optid,
DBUG_ENTER("get_one_option"); DBUG_ENTER("get_one_option");
switch (optid) { switch (optid) {
case '?': case '?':
printf("%s\n", USAGETEXT);
my_print_help(my_long_options); my_print_help(my_long_options);
exit(0); exit(0);
break; break;
...@@ -410,6 +418,12 @@ int main(int argc, char **argv) ...@@ -410,6 +418,12 @@ int main(int argc, char **argv)
char bindir[FN_REFLEN]; char bindir[FN_REFLEN];
char *p; char *p;
/* Parse options */
if ((error= handle_options(&argc, &argv, my_long_options, get_one_option)))
die("");
if(!opt_service)
die("service parameter is mandatory");
/* /*
Get full path to mysqld, we need it when changing service configuration. Get full path to mysqld, we need it when changing service configuration.
Assume installation layout, i.e mysqld.exe, mysqladmin.exe, mysqlupgrade.exe Assume installation layout, i.e mysqld.exe, mysqladmin.exe, mysqlupgrade.exe
...@@ -432,13 +446,6 @@ int main(int argc, char **argv) ...@@ -432,13 +446,6 @@ int main(int argc, char **argv)
die("File %s does not exist", paths[i]); die("File %s does not exist", paths[i]);
} }
/* Parse options */
if ((error= handle_options(&argc, &argv, my_long_options, get_one_option)))
die("");
if(!opt_service)
die("service parameter is mandatory");
/* /*
Messages written on stdout should not be buffered, GUI upgrade program Messages written on stdout should not be buffered, GUI upgrade program
read them from pipe and uses as progress indicator. read them from pipe and uses as progress indicator.
...@@ -451,6 +458,7 @@ int main(int argc, char **argv) ...@@ -451,6 +458,7 @@ int main(int argc, char **argv)
log("Phase 2/8: Stopping service"); log("Phase 2/8: Stopping service");
stop_mysqld_service(); stop_mysqld_service();
/* /*
Start mysqld.exe as non-service skipping privileges (so we do not Start mysqld.exe as non-service skipping privileges (so we do not
care about the password). But disable networking and enable pipe care about the password). But disable networking and enable pipe
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment