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

QCommandLineParser should report application name in error messages

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • Not Evaluated
    • 5.13.0 Alpha 1
    • 5.7.1
    • Core: Other
    • None
    • Linux; Qt 5.7.1 HEAD at 0150c62f from git://code.qt.io/qt/qt5.git

    • 50d53533e5ab1923865a9f80cb8b093ab477ae81

    Description

      On Unix the standard convention is for an error message to be preceded by the name of the command or utility that generated it. This is especially useful to identify the source of an error when the command is used in a script or makefile, or in a desktop environment where it may appear in an extensive session log.

      QCommandLineParser does not seem to do this:

      $ uic --version
      uic 5.7.1
      $ uic --foo
      Unknown option 'foo'.
      $ uic -foo
      Unknown option 'foo'.
      $ uic -f
      Unknown option 'f'.
      $

      It would be more helpful if it reported the command name, as available from QCoreApplication::applicationName(). This defaults to the name of the executable, so providing the standard error reporting behaviour. What should be seen is:

      $ uic -f
      uic: Unknown option 'f'.
      $

      Attachments

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

        Activity

          People

            dfaure_kdab David Faure
            marten Jonathan Marten
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes