Bug #68420 MySQL programs produce out of order --help entries
Submitted: 18 Feb 2013 19:18 Modified: 18 Feb 2013 19:33
Reporter: Paul DuBois Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.5+ OS:Any
Assigned to: CPU Architecture:Any

[18 Feb 2013 19:18] Paul DuBois
Description:
mysqld --verbose --help sorts entries in the help message so that they appear in order by long option name.

MySQL client programs do not do so, which often results in --help output that is confusing and more difficult to use than it need be. If you don't see an option where you expect it, it can be difficult to determine whether you simply overlooked it somewhere else, or whether it's just not present at all.

Here's an example, using 5.6.11 mysql --help

...

  -v, --verbose       Write more. (-v -v -v gives the table output format).
  -V, --version       Output version information and exit.
  -w, --wait          Wait and retry if connection is down.
  --connect-timeout=# Number of seconds before connection timeout.
  --max-allowed-packet=# 
                      The maximum packet length to send to or receive from
                      server.
  --net-buffer-length=# 
                      The buffer size for TCP/IP and socket communication.
  --select-limit=#    Automatic limit for SELECT when using --safe-updates.
  --max-join-size=#   Automatic limit for rows in a join when using
                      --safe-updates.
  --secure-auth       Refuse client connecting to server if it uses old
                      (pre-4.1.1) protocol.
                      (Defaults to on; use --skip-secure-auth to disable.)
  --server-arg=name   Send embedded server this as a parameter.
  --show-warnings     Show warnings after every statement.
  --plugin-dir=name   Directory for client-side plugins.
  --default-auth=name Default authentication client-side plugin to use.
  --histignore=name   A colon-separated list of patterns to keep statements
                      from getting logged into mysql history.
  --binary-mode       By default, ASCII '\0' is disallowed and '\r\n' is
                      translated to '\n'. This switch turns off both features,
                      and also turns off parsing of all clientcommands except
                      \C and DELIMITER, in non-interactive mode (for input
                      piped to mysql or loaded using the 'source' command).
                      This is necessary when processing output from mysqlbinlog
                      that may contain blobs.
  --server-public-key-path=name 
                      File path to the server public RSA key in PEM format.
...

If you were looking for --binary-mode, you would not expect to find it at the end of the option list.

How to repeat:
mysql --help

But other programs have similar problems.

Suggested fix:
Maybe use whatever mechanism mysqld uses to sort its --help output?
[18 Feb 2013 19:33] Sveta Smirnova
Thank you for the report.

Verified as described.