Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to change usage part of console app?
Forum Updated to NodeBB v4.3 + New Features

How to change usage part of console app?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 380 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kien Bui
    wrote on last edited by Kien Bui
    #1

    I am writing a console app,
    I used QCommandLineParse and then add QCommandLineOption, add addPositionalArgument.
    And when it shows help the usage part always show that:

    Usage:./app [options] command
    

    I want to relocate options to after command.

    Usage:./app command [options]
    
    aha_1980A 1 Reply Last reply
    0
    • K Kien Bui

      I am writing a console app,
      I used QCommandLineParse and then add QCommandLineOption, add addPositionalArgument.
      And when it shows help the usage part always show that:

      Usage:./app [options] command
      

      I want to relocate options to after command.

      Usage:./app command [options]
      
      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Kien-Bui

      What happens if you call addPositionalArgument first and after that QCommandLineOption?

      Qt has to stay free or it will die.

      K 1 Reply Last reply
      0
      • aha_1980A aha_1980

        @Kien-Bui

        What happens if you call addPositionalArgument first and after that QCommandLineOption?

        K Offline
        K Offline
        Kien Bui
        wrote on last edited by
        #3

        @aha_1980 Nope. :)))

        aha_1980A 1 Reply Last reply
        0
        • K Kien Bui

          @aha_1980 Nope. :)))

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Kien-Bui

          Have you tried: http://doc.qt.io/qt-5/qcommandlineparser.html#setOptionsAfterPositionalArgumentsMode ?

          Qt has to stay free or it will die.

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved