Skip to content

Latest commit

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

cppcommandline

Command line parser for C++11 and later using the fluid interface.

features

  • fluid interface
  • short and long names for options
  • positional arguments
  • value bindings
  • default values
  • required options
  • option descriptions
  • application name extraction
  • automatic help
  • error handling using standard exceptions

usage

#include <cppcommandline.h>
int main(int argc, char **argv)
{
cppcommandline::Parser commandLine;
std::string filename;
int someoption = 0;
bool flag = false;
commandLine.option().withDescription("A required filename").required().bindTo(filename); //positional
commandLine.option("someoption").asShortName("s").withDefaultValue(10).withDescription("My description of someoption").bindTo(someoption);
commandLine.option("flag").withDefaultValue(false).withDescription("My flag").bindTo(flag);
commandLine.parse(argc, argv);
return 0;
}

About

Simple C++ strongly typed command line parser with fluid interface

Topics

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages