From 526ce669ed41e3285fb13a1e3f394d7722db3ab3 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 3 May 2023 14:39:07 +0200 Subject: 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 Reviewed-by: David Faure --- src/corelib/tools/qcommandlineparser.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/corelib/tools/qcommandlineparser.cpp') diff --git a/src/corelib/tools/qcommandlineparser.cpp b/src/corelib/tools/qcommandlineparser.cpp index ba4dae62b80..0bab9dafe4a 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; -- cgit v1.2.3