ProjectsOption++

Option++

Documentation Download Examples GitHub Repository Tutorial

Option++ is a C++ library for reading command-line program options. Option++ provides an easy way to read, validate, and process command-line arguments and it can also print detailed program help information.

A single-header version of the library is available. If you use the single-header file, you must define the macro OPTIONPP_MAIN in exactly one source file before including the header.

Features

  • Supports the usual Unix and GNU/Linux conventions
    • Use long (--option) and short (-o) option names
    • Double dash by itself (--) indicates end of options
    • Options may have mandatory or optional arguments
  • Can parse arguments passed to main directly, or can read options from a string
  • Allows you to bind variables to particular options
  • Input validation for numerical arguments
  • Can automatically generate a help message
  • Options can be separated into groups for better organization
  • Easily iterate over all parsed data
  • Exception-based error handling

Download

Select an option below to download Option++. The source code is also available on GitHub.

Option++ 2.0   (2020-06-09)

Copyright © 2017-2020 Greg Kikola. License BSL-1.0: Boost Software License version 1.0 .

Option++ is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. See the file LICENSE.txt which accompanies the source code for more details.