Commit 16e3968e1a829f2057ce44baf373b3639d31272d
1 parent
0f819a5c
update readme
Showing
1 changed file
with
11 additions
and
1 deletions
README.md
| @@ -52,6 +52,17 @@ exception will be thrown. | @@ -52,6 +52,17 @@ exception will be thrown. | ||
| 52 | Note that the result of `options.parse` should only be used as long as the | 52 | Note that the result of `options.parse` should only be used as long as the |
| 53 | `options` object that created it is in scope. | 53 | `options` object that created it is in scope. |
| 54 | 54 | ||
| 55 | +## Exceptions | ||
| 56 | + | ||
| 57 | +Exceptional situations throw C++ exceptions. There are two types of | ||
| 58 | +exceptions: errors defining the options, and errors when parsing a list of | ||
| 59 | +arguments. All exceptions derive from `cxxopts::OptionException`. Errors | ||
| 60 | +defining options derive from `cxxopts::OptionSpecException` and errors | ||
| 61 | +parsing arguments derive from `cxxopts::OptionParseException`. | ||
| 62 | + | ||
| 63 | +All exceptions define a `what()` function to get a printable string | ||
| 64 | +explaining the error. | ||
| 65 | + | ||
| 55 | ## Help groups | 66 | ## Help groups |
| 56 | 67 | ||
| 57 | Options can be placed into groups for the purposes of displaying help messages. | 68 | Options can be placed into groups for the purposes of displaying help messages. |
| @@ -116,4 +127,3 @@ expressions. For example GCC >= 4.9 or clang with libc++. | @@ -116,4 +127,3 @@ expressions. For example GCC >= 4.9 or clang with libc++. | ||
| 116 | # TODO list | 127 | # TODO list |
| 117 | 128 | ||
| 118 | * Allow unrecognised options. | 129 | * Allow unrecognised options. |
| 119 | -* Various help strings. |