Details
-
User Story
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.12.1
-
None
-
Linux
Description
QCommandLineParser automatically generates help string when addHelpOption() is used. However the generated usage line with executable is not customizable and automatically display the full path to binary, which does not look nice:
Usage: /home/userA/git/build-kjut-Desktop_Qt_5_12_0_GCC_64bit2-Debug/bin/visualizer.exe [options]
Options:
-h, --help Displays this help.
-v, --version Displays version information.
...
There is currently no way to customize the "Usage: ..." line, except for manually generating the complete help message from QString.
It would be nice to have a method similar to setApplicationDescription(const QString&), e.g. setApplicationExecutable(const QString&) that will allow for overriding the default generated executable path, i.e. for the above example:
parser.setApplicationExecutable("visualizer");
parser.addHelpOption();
will result in the following help text:
Usage: visualizer [options]
Options:
-h, --help Displays this help.
-v, --version Displays version information.
...