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

QCommandLineParser not processing option value if value name is not supplied

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.6.2
    • 5.6.1
    • Documentation
    • None
    • Debian _stretch_, Linux 4.6.0-amd64
    • f0685992a3412b059a0952ac591f40856ffffb6f

    Description

      When command line options are parsed by the command line parser if a value name isn't supplied the parsing will fail and the option will not have a value. In my opinion it shouldn't be required to supply a third parameter for the option constructor (value name), because it's only relevant for the display of the option's help text. But even if it is a requirement, it should be made explicit in the documentation.

      Currently the docs read:
      In addition, the valueName can be set if the option expects a value. The default value for the option is set to defaultValue.

      If valueName is indeed a requirement, then it should read:
      In addition, the valueName can should/must be set if the option expects a value. The default value for the option is set to defaultValue.

      You can find attached a MWE that reproduces the issue.

      PS.
      Also present with about a week old dev branch build.

      Attachments

        1. clp-values-bug.pro
          0.1 kB
        2. main.cpp
          1.0 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dfaure_kdab David Faure
            kshegunov Konstantin Shegunov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes