dav/optparser.c

changeset 68
f6d3db6113d3
parent 62
3b813c57c106
child 74
da079dc0724c
--- a/dav/optparser.c	Fri Dec 12 13:57:41 2014 +0100
+++ b/dav/optparser.c	Fri Dec 12 15:19:38 2014 +0100
@@ -43,6 +43,8 @@
     a->argv = calloc(argc, sizeof(char*));
     a->argc = 0;
     
+    const char *NOARG = "";
+    
     char *option = NULL;
     char optchar = 0;
     for(int i=0;i<argc;i++) {
@@ -56,6 +58,10 @@
                         cmd_args_free(a);
                         return NULL;
                     }
+                    case 'v': {
+                        ucx_map_cstr_put(a->options, "verbose", NOARG);
+                        break;
+                    }
                     case 'k': {
                         if(!option) {
                             option = "key";
@@ -71,27 +77,27 @@
                         break;
                     }
                     case 'p': {
-                        ucx_map_cstr_put(a->options, "plain", "");
+                        ucx_map_cstr_put(a->options, "plain", NOARG);
                         break;
                     }
                     case 'c': {
-                        ucx_map_cstr_put(a->options, "crypt", "");
+                        ucx_map_cstr_put(a->options, "crypt", NOARG);
                         break;
                     }
                     case 'a': {
-                        ucx_map_cstr_put(a->options, "all", "");
+                        ucx_map_cstr_put(a->options, "all", NOARG);
                         break;
                     }
                     case 'l': {
-                        ucx_map_cstr_put(a->options, "list", "");
+                        ucx_map_cstr_put(a->options, "list", NOARG);
                         break;
                     }
                     case 't': {
-                        ucx_map_cstr_put(a->options, "type", "");
+                        ucx_map_cstr_put(a->options, "type", NOARG);
                         break;
                     }
                     case 'R': {
-                        ucx_map_cstr_put(a->options, "recursive", "");
+                        ucx_map_cstr_put(a->options, "recursive", NOARG);
                         break;
                     }
                     case 'o': {

mercurial