summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-05-05 14:24:25 +0200
committerSergei Golubchik <sergii@pisem.net>2014-05-05 14:24:25 +0200
commita313864814c58e0f35a0baa8c163e40d0d0c3b69 (patch)
tree77d4aa5195224ac00fa5ed31dfbec543527899d7 /client
parent5401d44708cd9dbf0d60c04505d245e75c261db8 (diff)
downloadmariadb-git-a313864814c58e0f35a0baa8c163e40d0d0c3b69.tar.gz
MDEV-6056 [PATCH] mysqldump writes usage to stdout even when not explicitly requested
Diffstat (limited to 'client')
-rw-r--r--client/mysqldump.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index fa02c74615c..ace22c1ec64 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -598,12 +598,12 @@ static void print_version(void)
} /* print_version */
-static void short_usage_sub(void)
+static void short_usage_sub(FILE *f)
{
- printf("Usage: %s [OPTIONS] database [tables]\n", my_progname_short);
- printf("OR %s [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]\n",
- my_progname_short);
- printf("OR %s [OPTIONS] --all-databases [OPTIONS]\n", my_progname_short);
+ fprintf(f, "Usage: %s [OPTIONS] database [tables]\n", my_progname_short);
+ fprintf(f, "OR %s [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]\n",
+ my_progname_short);
+ fprintf(f, "OR %s [OPTIONS] --all-databases [OPTIONS]\n", my_progname_short);
}
@@ -612,18 +612,18 @@ static void usage(void)
print_version();
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
puts("Dumping structure and contents of MySQL databases and tables.");
- short_usage_sub();
+ short_usage_sub(stdout);
print_defaults("my",load_default_groups);
puts("");
-my_print_help(my_long_options);
+ my_print_help(my_long_options);
my_print_variables(my_long_options);
} /* usage */
-static void short_usage(void)
+static void short_usage(FILE *f)
{
- short_usage_sub();
- printf("For more options, use %s --help\n", my_progname_short);
+ short_usage_sub(f);
+ fprintf(f, "For more options, use %s --help\n", my_progname_short);
}
@@ -996,7 +996,7 @@ static int get_options(int *argc, char ***argv)
exit(1);
if ((*argc < 1 && !opt_alldbs) || (*argc > 0 && opt_alldbs))
{
- short_usage();
+ short_usage(stderr);
return EX_USAGE;
}
if (tty_password)