Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
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.