summaryrefslogtreecommitdiff
path: root/mysys/my_getopt.c
diff options
context:
space:
mode:
authorMagne Mahre <magne.mahre@sun.com>2009-11-03 10:22:22 +0100
committerMagne Mahre <magne.mahre@sun.com>2009-11-03 10:22:22 +0100
commit6e916e03bddfce67d0c3563dc017323d0243db05 (patch)
treebf8664f841ae4881e65c93fff86d57c250be39ee /mysys/my_getopt.c
parentee15f23ca65e77264750c4bc7d866e2de00b4666 (diff)
downloadmariadb-git-6e916e03bddfce67d0c3563dc017323d0243db05.tar.gz
Bug#35224: mysqldump --help is very confusing
The presence of "--skip" parameters is obscure, when it should be obvious from the text. Now, for boolean options, when they're default to ON and the --skip is more useful parameter, then tell the user of its existence. Backported from 6.0-codebase, revid 2572.14.1
Diffstat (limited to 'mysys/my_getopt.c')
-rw-r--r--mysys/my_getopt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 22b1216f99c..533a29c9fd4 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -1220,6 +1220,14 @@ void my_print_help(const struct my_option *options)
printf("%s", comment);
}
putchar('\n');
+ if ((optp->var_type & GET_TYPE_MASK) == GET_NO_ARG ||
+ (optp->var_type & GET_TYPE_MASK) == GET_BOOL)
+ {
+ if (optp->def_value != 0)
+ {
+ printf("%*s(Defaults to on; use --skip-%s to disable.)\n", name_space, "", optp->name);
+ }
+ }
}
}