#At file:///data/z/mysql-next-mr-runtime/ based on revid:alik@stripped
2904 Magne Mahre 2009-11-03
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
modified:
client/mysqlcheck.c
client/mysqldump.c
mysys/my_getopt.c
=== modified file 'client/mysqlcheck.c'
--- a/client/mysqlcheck.c 2009-10-22 20:20:44 +0000
+++ b/client/mysqlcheck.c 2009-11-03 09:22:22 +0000
@@ -128,7 +128,7 @@ static struct my_option my_long_options[
"Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"write-binlog", OPT_WRITE_BINLOG,
- "Log ANALYZE, OPTIMIZE and REPAIR TABLE commands. Enabled by default; use --skip-write-binlog when commands should not be sent to replication slaves.",
+ "Log ANALYZE, OPTIMIZE and REPAIR TABLE commands. Use --skip-write-binlog when commands should not be sent to replication slaves.",
(uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
{"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
=== modified file 'client/mysqldump.c'
--- a/client/mysqldump.c 2009-10-14 16:37:38 +0000
+++ b/client/mysqldump.c 2009-11-03 09:22:22 +0000
@@ -402,7 +402,7 @@ static struct my_option my_long_options[
(uchar**) &opt_routines, (uchar**) &opt_routines, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"set-charset", OPT_SET_CHARSET,
- "Add 'SET NAMES default_character_set' to the output. Enabled by default; suppress with --skip-set-charset.",
+ "Add 'SET NAMES default_character_set' to the output.",
(uchar**) &opt_set_charset, (uchar**) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
{"set-variable", 'O',
=== modified file 'mysys/my_getopt.c'
--- a/mysys/my_getopt.c 2009-10-02 08:25:53 +0000
+++ b/mysys/my_getopt.c 2009-11-03 09:22:22 +0000
@@ -1220,6 +1220,14 @@ void my_print_help(const struct my_optio
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);
+ }
+ }
}
}
Attachment: [text/bzr-bundle] bzr/magne.mahre@sun.com-20091103092222-jpccahjnyy7i45s4.bundle
Thread |
---|
• bzr commit into mysql-5.5-next-mr-runtime branch (magne.mahre:2904)Bug#35224 | Magne Mahre | 3 Nov |