diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2023-05-03 14:39:07 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-05-15 14:02:43 +0200 |
commit | 526ce669ed41e3285fb13a1e3f394d7722db3ab3 (patch) | |
tree | a198e926f9a892771ba48a2735907fb80c781d2d /src | |
parent | 56df9e5603b33d0fe6264c185030785b5587f8b6 (diff) |
Clean up phrasing of --help-all and other help options
The options included by --help-all, although they are "specific to
Qt", are "specific" to all Qt applications, so - in the present
context, of QCommandLineParser - not specific at all. It's the options
described by -h that are specific, to the present command; the Qt
options are generic (in the present context).
So rework the help string for --help-all itself and the documentation
of the function. It had, in any case, an overly-complex first line,
that descended into too much detail. Updated test to match.
Pick-to: 6.5
Task-number: QTBUG-111228
Change-Id: I06da0af41be60e6e1b7616984001ddb9ca33aad6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qcommandlineparser.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/corelib/tools/qcommandlineparser.cpp b/src/corelib/tools/qcommandlineparser.cpp index ba4dae62b8..0bab9dafe4 100644 --- a/src/corelib/tools/qcommandlineparser.cpp +++ b/src/corelib/tools/qcommandlineparser.cpp @@ -389,13 +389,17 @@ QCommandLineOption QCommandLineParser::addVersionOption() } /*! - Adds the help option (\c{-h}, \c{--help} and \c{-?} on Windows) - as well as an option \c{--help-all} to include Qt-specific options in the output. + Adds help options to the command-line parser. + + The options specified for this command-line are described by \c{-h} or + \c{--help}. On Windows, the alternative \c{-?} is also supported. The option + \c{--help-all} extends that to include generic Qt options, not defined by + this command, in the output. These options are handled automatically by QCommandLineParser. - Remember to use setApplicationDescription to set the application description, - which will be displayed when this option is used. + Remember to use \c setApplicationDescription() to set the application + description, which will be displayed when this option is used. Example: \snippet code/src_corelib_tools_qcommandlineparser_main.cpp 0 @@ -411,7 +415,8 @@ QCommandLineOption QCommandLineParser::addHelpOption() << QStringLiteral("h") << QStringLiteral("help"), tr("Displays help on commandline options.")); addOption(opt); - QCommandLineOption optHelpAll(QStringLiteral("help-all"), tr("Displays help including Qt specific options.")); + QCommandLineOption optHelpAll(QStringLiteral("help-all"), + tr("Displays help, including generic Qt options.")); addOption(optHelpAll); d->builtinHelpOption = true; return opt; |