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 59461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:00:32+00:00 2026-05-10T18:00:32+00:00

I know of the following: The venerable getopt(3) The extended getopt_long glibc’s argp parser

  • 0

I know of the following:

  • The venerable getopt(3)
  • The extended getopt_long
  • glibc’s argp parser for Unix-style argument vectors
  • popt from the GNOME project (or its spiritual successor in Glib)

I’m sure there’s more that I haven’t used or even heard of; a quick Google search reveals Gopt, argtable, and Optlist.

Personally, I like argp best, and every program I wrote using getopt/getopt_long (beyond a certain baseline of complexity) has been converted to use argp. It’s more widely available than popt, more powerful than getopt_long, well-documented, consistent with all the GNU-style conventions, and very flexible. On the downside, it’s far from the easiest to use (thanks to being so flexible), and the code to support it is quite verbose (as are many things in C).

What do you use, and why?

Yes, I mean C rather than C++. There are a ton of C++ parsers, but I don’t use C++.

John Millikin notes that popt is no longer maintained. I list it because many programs still use it — including AbiWord, rpm, rsync, and samba — despite Gnome’s efforts to migrate away. But I’ve added a link to Glib’s argument parser now, too.


For C++ argument parsing, see the question What parameter parser libraries are there for C++?

  • 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. 2026-05-10T18:00:33+00:00Added an answer on May 10, 2026 at 6:00 pm

    GNU has gengetopt which generates code for an options data structure and the getopt_long code to parse the command line and fill the structure.. It’s fairly easy to learn and works well.

    As a bonus you can pass the options structure around your code and avoid global storage if desired.

    It provides GNU style semantics (obviously), and is small enough to simply include with the project for distribution if you’re not sure of your audience’s build environment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know following is the way to use unicode in C# string unicodeString =
I would like to know following: I added the folder Graphics into my project
I know the following function can be used to do some pre-save processing. But,
I know the following is not possible because the Enumeration's type has to be
I know the following code could extract whole texts of the docx document, however,
I don't know why following query doesn't work: //a/@href[@class='specified_string']
Most of you probably know the following problem: You edit an HTML, view the
It's about android application memory leak of Thread object. I didn't know yet following
I know that the following code should show and hide a tiny circular progress
I know that the following works but it is not that readable, is there

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.