Commit 1c7175ad authored by COULAUD Olivier's avatar COULAUD Olivier
Browse files

Update README.md

parent 0dbb7c49
# Command Line Parser
# Parser for command Line options
The command line parser allows you to easyly managed command line arguments
......@@ -50,7 +50,7 @@ struct delta
};
```
Now let's add a required flag that will throw an exception if not provided :
Now let's add a required flag that will throw an exception if not provided
```cpp
\\ you need to inherit from required_tag to register your flag as required.
......@@ -62,7 +62,7 @@ struct input_file : cpp_tools::cl_parser::required_tag
};
```
After defining all of our flags, we can create our parser :
After defining all of our flags, we create our parser:
```cpp
auto main(int argc, char* argv[]) -> int
......@@ -81,9 +81,11 @@ auto main(int argc, char* argv[]) -> int
Note that we added the `cpp_tools::cl_parser::help{}` flag to generate automaticaly
the help command line argument.
And finally we can access the flag value as follow :
And finally we access the flag value by the `get` method as follow
```cpp
const auto n_count = parser.get<n_count>();
const auto file = parser.get<input_file>();
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment