2419 char *name = assistant_getcfg("name"); |
2419 char *name = assistant_getcfg("name"); |
2420 if(!name) { |
2420 if(!name) { |
2421 fprintf(stderr, "Abort\n"); |
2421 fprintf(stderr, "Abort\n"); |
2422 return -1; |
2422 return -1; |
2423 } |
2423 } |
2424 if(get_repository(cx_str(name))) { |
2424 if(dav_config_get_repository(get_config(), cx_str(name))) { |
2425 fprintf(stderr, "Repository %s already exists.\nAbort\n", name); |
2425 fprintf(stderr, "Repository %s already exists.\nAbort\n", name); |
2426 return -1; |
2426 return -1; |
2427 } |
2427 } |
2428 |
2428 |
2429 printf("\nSpecify the repository base url.\n"); |
2429 printf("\nSpecify the repository base url.\n"); |
3115 repocomp = 0; |
3115 repocomp = 0; |
3116 break; |
3116 break; |
3117 } |
3117 } |
3118 } |
3118 } |
3119 if(repocomp) { |
3119 if(repocomp) { |
3120 CxIterator i = get_repositories(); |
3120 DavConfig *config = get_config(); |
3121 cx_foreach(Repository*, repo, i) { |
3121 for(DavCfgRepository *repo=config->repositories; repo; repo=repo->next) { |
3122 if(cx_strprefix(cx_str(repo->name), url)) { |
3122 if(cx_strprefix(cx_strcast(repo->name.value), url)) { |
3123 if(quote == '\0') { |
3123 if(quote == '\0') { |
3124 printf("%s/\n", repo->name); |
3124 printf("%s/\n", repo->name.value.ptr); |
3125 } else { |
3125 } else { |
3126 printf("%c%s/%c\n", quote, repo->name, quote); |
3126 printf("%c%s/%c\n", quote, repo->name.value.ptr, quote); |
3127 } |
3127 } |
3128 } |
3128 } |
3129 |
3129 |
3130 } |
3130 } |
3131 } else { |
3131 } else { |