dav/main.c

changeset 198
44054c452de1
parent 197
79a866256be4
child 199
f448fc8c9191
equal deleted inserted replaced
197:79a866256be4 198:44054c452de1
121 ret = cmd_get_property(args); 121 ret = cmd_get_property(args);
122 } else if(!strcasecmp(cmd, "info")) { 122 } else if(!strcasecmp(cmd, "info")) {
123 ret = cmd_info(args); 123 ret = cmd_info(args);
124 } else if(!strcasecmp(cmd, "add-repository")) { 124 } else if(!strcasecmp(cmd, "add-repository")) {
125 ret = cmd_add_repository(args); 125 ret = cmd_add_repository(args);
126 } else if(!strcasecmp(cmd, "list-repositories")) {
127 ret = list_repositories();
126 } else if(!strcasecmp(cmd, "version") || !strcasecmp(cmd, "-version") || !strcasecmp(cmd, "--version")) { 128 } else if(!strcasecmp(cmd, "version") || !strcasecmp(cmd, "-version") || !strcasecmp(cmd, "--version")) {
127 #ifdef DEBUG 129 #ifdef DEBUG
128 fprintf(stderr, "dav %s unstable\n", DAV_VERSION); 130 fprintf(stderr, "dav %s unstable\n", DAV_VERSION);
129 #else 131 #else
130 fprintf(stderr, "dav %s\n", DAV_VERSION); 132 fprintf(stderr, "dav %s\n", DAV_VERSION);
181 fprintf(stderr, " -t print content type\n"); 183 fprintf(stderr, " -t print content type\n");
182 fprintf(stderr, " -O override resources\n"); 184 fprintf(stderr, " -O override resources\n");
183 fprintf(stderr, " -n <uri> specify namespace uri\n"); 185 fprintf(stderr, " -n <uri> specify namespace uri\n");
184 fprintf(stderr, " -v verbose output\n"); 186 fprintf(stderr, " -v verbose output\n");
185 fprintf(stderr, "\n"); 187 fprintf(stderr, "\n");
186 fprintf(stderr, "Config Commands:\n"); 188 fprintf(stderr, "Config commands:\n");
187 fprintf(stderr, " add-repository\n"); 189 fprintf(stderr, " add-repository\n");
190 fprintf(stderr, " list-repositories\n");
188 fprintf(stderr, "\n"); 191 fprintf(stderr, "\n");
189 fprintf(stderr, 192 fprintf(stderr,
190 "Instead of an url you can pass a repository name " 193 "Instead of an url you can pass a repository name "
191 "with an optional path:\n"); 194 "with an optional path:\n");
192 fprintf(stderr, " <repository>/path/\n"); 195 fprintf(stderr, " <repository>/path/\n");
764 if(dav_create(res)) { 767 if(dav_create(res)) {
765 fprintf(stderr, "Cannot create resource.\n"); 768 fprintf(stderr, "Cannot create resource.\n");
766 return -1; 769 return -1;
767 } 770 }
768 } else { 771 } else {
769 if(sn->errorstr) { 772 print_resource_error(sn, path);
770 fprintf(stderr, "Error: %s\n", sn->errorstr);
771 } else {
772 fprintf(stderr, "Error\n");
773 }
774 return -1; 773 return -1;
775 } 774 }
776 } else if(res->iscollection) { 775 } else if(res->iscollection) {
777 // TODO: free res 776 // TODO: free res
778 char *newpath = util_concat_path(path, name); 777 char *newpath = util_concat_path(path, name);

mercurial