Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6808557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:58:15+00:00 2026-05-26T19:58:15+00:00

I would like that a text is printed before the description of the allowed

  • 0

I would like that a text is printed before the description of the allowed options when I print my options_description. Something like :

This program counts from 1 to 10. <--- this is what is missing

Generic options:
-h [ --help ]         Produce help message.
-v [ --version ]      Show program name/version banner and exit.

Currently I add it by hand :

if (vm.count("help")) {
    cout << "options_description\n\n" << my_options_description << endl;
    return 1;
}

Is it possible to store this directly in the options_description object ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:58:16+00:00Added an answer on May 26, 2026 at 7:58 pm

    The options_description class is for describing the options, not the program. The Program_options library isn’t really intended for general-purpose documentation.

    I suppose you could abuse the label:

    po::options_description options(
      "This program counts from 1 to 10.\n\nGeneric options");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an anchor element that looks like this <a href=url><img src=imgurl/>Text</a> I would
I saw this demo once that printed out a paragraph of text (like you'd
I would like to have a text field that a user can enter a
I have a huge text file that I would like to split into multiple
I would like to write a command line tool that passes some formatted text
I have text file with some stuff that i would like to put into
I have some text in a UITextView, that I would like to have show
I would like do something like that. list_of_urls = ['http://www.google.fr/', 'http://www.google.fr/', 'http://www.google.cn/', 'http://www.google.com/', 'http://www.google.fr/',
I would like that the Index action doesn't appear in the url. For example,
I would like that whenever I run git diff or git show it silently

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.