Commit 0dae88ca authored by Magne Mahre's avatar Magne Mahre

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
parent c5022793
......@@ -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,
......
......@@ -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',
......
......@@ -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);
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment