Skip to content

Commit 87618de

Browse files
authored
Created README
1 parent e50e9ac commit 87618de

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# cppcommandline
2+
3+
Command line parser for C++11 and later using the fluid interface.
4+
5+
# features
6+
7+
- fluid interface
8+
- short and long names for options
9+
- positional arguments
10+
- value bindings
11+
- default values
12+
- required options
13+
- option descriptions
14+
- application name extraction
15+
- automatic help
16+
- error handling using standard exceptions
17+
18+
# usage
19+
20+
```
21+
#include <cppcommandline.h>
22+
23+
int main(int argc, char **argv)
24+
{
25+
cppcommandline::Parser commandLine;
26+
27+
std::string filename;
28+
int someoption = 0;
29+
bool flag = false;
30+
31+
commandLine.option().withDescription("A required filename").required().bindTo(filename); //positional
32+
commandLine.option("someoption").asShortName("s").withDefaultValue(10).withDescription("My description of someoption").bindTo(someoption);
33+
commandLine.option("flag").withDefaultValue(false).withDescription("My flag").bindTo(flag);
34+
commandLine.parse(argc, argv);
35+
36+
return 0;
37+
}
38+
```

0 commit comments

Comments
 (0)