1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MWL#55 : Add banner text to command line utilities

(Philip's review)
This commit is contained in:
Vladislav Vaintroub
2011-02-03 18:56:30 +01:00
parent 3cb88652dd
commit d99fbf4867
2 changed files with 23 additions and 8 deletions

View File

@ -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,
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;

View File

@ -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,
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,7 +418,13 @@ 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
and mysql_upgrade_service.exe are in the same directory. and mysql_upgrade_service.exe are in the same directory.
@ -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)
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