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

QCommandLineParser should support slashes as switch characters

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Won't Do
    • P3: Somewhat important
    • None
    • None
    • Core: Other
    • None

    Description

      On Windows, command line switches cannot only be marked by dashes and double dashes but also slashes. According to Wikipedia it's possible to support either of these or both as switch characters for command line arguments.

      Options that a windows application has are:

      • Only support dashes
        • "-inputfile foobar" valid
        • "/inputfile foobar" invalid
      • Only support slashes
        • "-inputfile foobar" invalid
        • "/inputfile foobar" valid
      • Support both dashes and slashes
        • "-inputfile foobar" valid
        • "/inputfile foobar" valid

      It might make sense to give the user an option about their desired behavior.

      These behaviors are incompatible with SingleDashWordOptionMode::ParseAsCompactedShortOptions so using them in combination should trigger a warning.

      Main use case: User has an application that uses / as a switch and wants to move from custom parsing to using QCommandLineParser.

      Attachments

        Activity

          People

            owolff Oliver Wolff
            owolff Oliver Wolff
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: