diff options
Diffstat (limited to 'extra/my_print_defaults.c')
-rw-r--r-- | extra/my_print_defaults.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index e91163dde1c..7695f669b1f 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -99,12 +99,16 @@ static struct my_option my_long_options[] = }; -static void usage(my_bool version) +static void version() { - printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, - MACHINE_TYPE); - if (version) - return; + printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE); +} + + +static void usage() __attribute__ ((noreturn)); +static void usage() +{ + version(); puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n"); puts("Prints all arguments that is give to some program using the default files"); printf("Usage: %s [OPTIONS] [groups]\n", my_progname); @@ -128,12 +132,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), exit(0); case 'I': case '?': - usage(0); + usage(); case 'v': verbose++; break; case 'V': - usage(1); + version(); + /* fall through */ case '#': DBUG_PUSH(argument ? argument : default_dbug_option); break; @@ -181,7 +186,7 @@ int main(int argc, char **argv) nargs+= array_elements(mysqld_groups); if (nargs < 2) - usage(0); + usage(); load_default_groups=(char**) my_malloc(nargs*sizeof(char*), MYF(MY_WME)); if (!load_default_groups) |