Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-133751

QCommandLineParser without valueName warning msg not good

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 6.8.2, 6.9.0 Beta2
    • Core: Other
    • None
    • All

    Description

      My code contains problem and I get warning message, but this message is not clear. I suggest to change warning message to make it more user-friendly.

      QCommandLineParser parser;
      QCommandLineOption NumOption(QStringList() << "n" << "num", "help text");
      parser.addOption(NumOption);
      const QString numStr= parser.value(NumOption); //warning 'option not expecting values' here
      

      To start app I use

      ./app --num 123
      QCommandLineParser: option not expecting values: "num"
      

      Solution on forum. But I suggest to change warning message from QCommandLineParser: option not expecting values: "num" to, for example, QCommandLineParser: you should also set valueName for: "num"

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            dungeonlords Andrei Cherniaev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes