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

QCommandLineParser::helpText() produces unreadable helps for long arguments

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.15.1
    • 5.12.2
    • Core: Other
    • None
    • f0ea852d4dd6b3139869a952ee92e74cd367866d (qt/qtbase/5.15)

    Description

      If we add one long option, say

      QCommandLineOption(
           QStringList() << QStringLiteral("looooooooooooong-option") << QStringLiteral("looooong-opt-alias"),
           QStringLiteral("Some long but meaningful option description"),
           QStringLiteral("looooooooooooong-option"))
      

      helpText produces really unureadable text. And there is no way to get all the data back to produce elegant help text.

      More of it, helpText' lines are always 80 chars wide even if terminal window is wider. So the example above results in description column only 3 characters wide!

      As far as I know, there is no standard for help descriptions. Some programs (clang) always starts option description output on 27'th column. If option name is long, description goes to next line. Some (gcc) starts after option name, but continues on next line from 28'th column. Either way theirs help is readable even for options with long names (or long synonym list).

      Attachments

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

        Activity

          People

            dfaure_kdab David Faure
            woodroof Danil Ilinykh
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes