The Lean Mean C++ Option Parser Icon

The Lean Mean C++ Option Parser

A no-dependencies C++ program arguments parser

18 Downloads (This Week)
Last Update:
Download optionparser-1.5.tar.gz
Browse All Files


The Lean Mean C++ Option Parser handles the program arguments (argc, argv). It supports the short and long option formats of getopt(), getopt_long() and getopt_long_only() but has a more convenient interface. It is a freestanding, header-only library with no dependencies, not even libc or STL. It comes with a usage message formatter that supports column alignment and line wrapping, making it ideal for localized messages with different lengths.

The Lean Mean C++ Option Parser Web Site


Software Development


MIT License


  • Header-only library. Just #include "optionparser.h" and you're set.
  • Freestanding. There are no dependencies whatsoever, not even the C or C++ standard library.
  • Usage message formatter that supports column alignment and line wrapping.
  • Unlike getopt() and derivatives it doesn't force you to loop through options sequentially. Instead you can access options directly like this:
  • if ( options[QUIET] ) ... //Test for presence of a switch in the argument vector:
  • if ( options[FOO].last()->type() == DISABLE ) ... // --enable-foo/--disable-foo: last one used wins
  • int verbosity = options[VERBOSE].count(); // -v verbose, -vv more verbose
  • for (Option* opt = options[FILE]; opt; opt = opt->next()) // go through all --file=<fname> arguments


Other Useful Business Software

Find out what (or who) is slowing down your network Icon

Get comprehensive network bandwidth analysis and performance monitoring with SolarWinds® Bandwidth Analyzer Pack.

Find out what (or who) is slowing down your network Icon
Network slow, but you don't know the cause? Use Bandwidth Analyzer Pack (BAP) to monitor and analyze network bandwidth performance and traffic patterns. With BAP, you can identify which users, applications, and protocols are consuming the most bandwidth. You can also monitor Wireless LAN Controller traffic to see what applications and clients are using your wireless network. Try it free for 30 days!

Additional Project Details

Intended Audience


User Interface


Programming Language




Thanks for helping keep SourceForge clean.

Screenshot instructions:
Red Hat Linux   Ubuntu

Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Briefly describe the problem (required):

Upload screenshot of ad (required):
Select a file, or drag & drop file here.

Please provide the ad click URL, if possible:

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks