Re: [PATCH 4/7] kconfig: qconf: use QCommandLineParser

From: Masahiro Yamada
Date: Wed Oct 23 2024 - 12:40:10 EST


On Wed, Oct 23, 2024 at 3:33 PM Rolf Eike Beer <eb@xxxxxxxxx> wrote:
>
> This has a much nicer output without manual processing. It also adds window
> management options from Qt for free.
>
> Signed-off-by: Rolf Eike Beer <eb@xxxxxxxxx>
> ---

The help message looks as follows:


$ ./scripts/kconfig/qconf --help
QSocketNotifier: Can only be used with threads started with QThread
Usage: ./scripts/kconfig/qconf [options] Kconfig

Options:
-s silent
-h, --help Displays help on commandline options.
--help-all Displays help including Qt specific options.

Arguments:
file config file to open



I want to see something better for the explanation of '-s'
and I want 'file' and 'Kconfig' to match.



> int main(int ac, char** av)
> {
> ConfigMainWindow* v;
> - const char *name;
> + configApp = new QApplication(ac, av);
> + QCommandLineParser cmdline;

Please rename 'cmdline' to 'parser' because this is
used in the code example.

https://doc.qt.io/qt-6/qcommandlineparser.html#details



> + QCommandLineOption silent("s", "silent");

How about this ?

silent("s", "Print this message and exit.");

The description is consistent with
"./scripts/kconfig/conf --help".



> + cmdline.addOption(silent);
> + cmdline.addHelpOption();
> + cmdline.addPositionalArgument("file", "config file to open", "Kconfig");

I think the third parameter is unneeded.
Then, the help message will look better.




--
Best Regards
Masahiro Yamada