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

[CoreLib] CBOR dump example stuck if no argument passed & missing description on CLI

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 6.8.4
    • Core: Serialization
    • None
    • Linux/X11, macOS

    Description

      CBOR example requires an argument (i.e., CBOR format file to parse).
      When the example is run through the CLI without any argument, it does not give any output and the CLI is just stuck, unless CTRL+C command is sent to kill the process. 

      Steps to Reproduce:

      1. Navigate to the cbordump example directory through the terminal
      2. mkdir build
      3. Qt/6.8.4/macos/bin/qt-cmake -S . -B build
      1. cd build 
      2. make
      3. now run the example from the terminal without any argument, like ./cbordump

      Actual Output:

      On running the example without any argument, the CLI is stuck on that line (screenshot attached).

      Expected Output:

      There should be some description, that an argument is required which is missing. 

      Reproducibility: 100%

      Observation:

      When the example is run through the Qt Creator, it gives out error:

      17:47:20: Starting /Users/anurup/Qt/Examples/Qt-6.8.4/corelib/serialization/cbordump/build/Qt_6_8_4_for_macOS-Debug/cbordump...
      cbordump: decoding failed at 0: Unexpected end of input data (more bytes needed)
      17:47:20: The command "/Users/anurup/Qt/Qt Creator.app/Contents/Resources/libexec/disclaim /Users/anurup/Qt/Examples/Qt-6.8.4/corelib/serialization/cbordump/build/Qt_6_8_4_for_macOS-Debug/cbordump" terminated with exit code 1. 

      Which is the expected output. 

      Note:

      Like the example html2pdf also requires arguments and if arguments are not passed, it gives a description as to what is expected:

      anurup@Anurups-MacBook-Pro build % ./html2pdf.app/Contents/MacOS/html2pdf 
      Usage: ./html2pdf.app/Contents/MacOS/html2pdf [options] INPUT OUTPUT
      Converts the web page INPUT into the PDF file OUTPUT.
      
      
      Options:
        -h, --help     Displays help on commandline options.
        --help-all     Displays help, including generic Qt options.
        -v, --version  Displays version information.
      
      
      Arguments:
        INPUT          Input URL for PDF conversion.
        OUTPUT         Output file name for PDF conversion.
      anurup@Anurups-MacBook-Pro build %  

      Something like this should be added to the cbor dump example. 

       

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              anjalota Anurup Jalota
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes