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

Add "enum values" to QCommandLineOption, including validation

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core: Other
    • Labels:
      None

      Description

      Highly related to, and mostly described in comments of: QTBUG-74594
      Don't start this task until whether or not to allow spaces in the "enum values" is resolved (ongoing discussion in QTBUG-74594). Spaces in the "enum values" should be allowed, and escaped by a backslash: \. It should probably also follow the same rules as QCommandLineOption's name: "must not be empty, must not start with a dash or a slash character, must not contain a = and cannot be repeated."

      Currently QCommandLineOption only allows you to give an option value "description", but it would be useful if you could supply a limited set of values for a given QCommandLineOption. ex: " --mode foo " and " --mode bar ", where only foo and bar are allowed following --mode, not any string. QCommandLineParser can/should validate the values and show it's --help and call exit() accordingly.

      Also worth mentioning that a "default enum value" (when the QCommandLineOption isn't provided by the user) should be specifiable.

        Attachments

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

          Activity

            People

            Assignee:
            dfaure_kdab David Faure
            Reporter:
            d3fault d3fault
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes