diff -r ba760f2195c3 -r fffe3a16a3de docs/src/modules.md --- a/docs/src/modules.md Sat May 12 14:13:53 2018 +0200 +++ b/docs/src/modules.md Sat May 12 14:50:09 2018 +0200 @@ -279,6 +279,70 @@ chaining with linked lists. Similarly to the list module, we provide a `UCX_MAP_FOREACH` macro to conveniently iterate through the key/value pairs. +### Parsing command line options + +Assume you want to parse command line options and record them within a map. +One way to do this is shown by the following code sample: +```C + UcxMap* options = ucx_map_new(16); + const char *NOARG = ""; + + char *option = NULL; + char optchar = 0; + for(int i=1;i 1 && arg[0] == '-') { + if(option) { + fprintf(stderr, + "Missing argument for option -%c\n", optchar); + return 1; + } + for(int c=1;c