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

  • Home
  • SEARCH
  • 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 8587299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:32:10+00:00 2026-06-11T22:32:10+00:00

I currently use some old C library for getting program options and would like

  • 0

I currently use some old C library for getting program options and would like to replace that with some proper C++ (mainly to become independent of that library, which is a real burden). I was looking into using boost.program_options, but am not sure it can support all I want. Some things I want is:

  1. allow the following command-line syntax: myprogram option=value (in particular, I don’t really want the --option value syntax)

  2. use a default value if no value is provided (obviously this can be done in my program, but support in the options library would be nice)

  3. allow default options (which are always present even if I don’t give them) and an automatic help output consisting of all the options and their descriptions

  4. allow mathematical parsing, i.e. (command line) myprogram option1=Pi option2=3/5 option3=sqrt(2) to give 3.1415…, 0.6, and 1.415… in my program

  5. allow single values to be expanded. Let option_3Dpoint correspond to an std::array<double,3>, I want both myprogram option_3Dpoint=0,0,0 and myprogram option_3Dpoint=0 (expanding to 0,0,0) to work

Which of these can be supported by boost.program_options? Are there any alternatives?

  • 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-06-11T22:32:12+00:00Added an answer on June 11, 2026 at 10:32 pm

    boost.program_options is very good library. You can use to parse config files aswell. Answers:

    1. Dont know but seems no builtin support.
    2. Yes.
    3. Yes.
    4. No unless you make your own expression evaluation handler or use some other boost libs to do this.
    5. Yes, you will need to write your own handler which creates 3DPoint object from string like 0,0,0
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently developing some user controls so that I can use them at
I'm currently maintaining some old code for a company. As it would happen, the
currently i'm trying to use imagick to generate some images without saving them on
Currently we have an application who use spring who support mysql. Some people prefer
I want to get into Erlang programming, specifically some yaws stuff. (Currently, I use
I am currently refactoring some old code. I am looking for directions on the
I would like some help in setting up a project in SVN with regards
I am currently working on a embedded C project and I inherited some old
I currently working on a application that use Entity Framework 4.1 (code first) and
We currently have a 10 year old nasty, spaghetti-code-style SQL Server database that we

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.