Description:
I just needed the "help" information on "my_print_defaults" and called it using "-?", here is a snippet of the output:
=====
Prints all arguments that is give to some program using the default files
Usage: my_print_defaults [OPTIONS] groups
-c, --config-file=name
Deprecated, please use --defaults-file instead. Name of
config file to read; if no extension is given, default
extension (e.g., .ini or .cnf) will be added
-#, --debug[=#] This is a non-debug version. Catch this and exit
-c, --defaults-file=name
Like --config-file, except: if first option, then read
this file only, do not read global or per-user config
files; should be the first option
=====
I see two problems with this snippet:
1) "-c" should not be listed twice:
Either it is the same as the (deprecated) "--config-file",
or the same as the (new) "--defalts-file" option, but it cannot be both.
Especially, it cannot be both when for one of these two an "except" clause is given, which means there really is a difference.
2) "--config-file" is deprecated, ok - so be it.
But then its replacement or successor, "--defaults-file", should be described just by itself, and not be based on the description of a deprecated option.
(It is ok to especially describe the difference, of course, but this should be done with the deprecated option so that it is read by those changing their calls, those who use the new option should not need to know how it differs from the old one.)
Further down, "-e" is again listed twice, but at least the deprecated option "--extra-file" is said to be a synonym for the new "--defaults-extra-file", so there is no functional difference (hopefully).
Still, "-e" should be listed only with the new option which is still valid, as "-e" is not (said to be) deprecated.
How to repeat:
Just call
my_print_defaults --help
Suggested fix:
1) Remove "-c" from the deprecated "--config-file" entry.
2) Change the description of "--defaults-file" so that it is complete in itself and does not refer to that of a deprecated option.
3) Remove "-e" from the deprecated "--extra-file" name.