216 fprintf(stderr, " -c Enable full encryption\n"); |
216 fprintf(stderr, " -c Enable full encryption\n"); |
217 fprintf(stderr, |
217 fprintf(stderr, |
218 " -R " |
218 " -R " |
219 "Recursively do the operation for all children\n"); |
219 "Recursively do the operation for all children\n"); |
220 fprintf(stderr, " -K Keep already present files\n"); |
220 fprintf(stderr, " -K Keep already present files\n"); |
221 fprintf(stderr, " -o <file> Write output to file\n"); |
221 fprintf(stderr, " -o <file> Write output to file (use '-' for stdout)\n"); |
222 fprintf( |
222 fprintf( |
223 stderr, |
223 stderr, |
224 " -u <date> " |
224 " -u <date> " |
225 "Get resources which are modified since the specified date\n"); |
225 "Get resources which are modified since the specified date\n"); |
226 fprintf(stderr, " -a show all files\n"); |
226 fprintf(stderr, " -a show all files\n"); |
1308 |
1308 |
1309 char *url1 = a->argv[0]; |
1309 char *url1 = a->argv[0]; |
1310 char *path1 = NULL; |
1310 char *path1 = NULL; |
1311 Repository *repo1 = url2repo(url1, &path1); |
1311 Repository *repo1 = url2repo(url1, &path1); |
1312 |
1312 |
|
1313 DavSession *sn = connect_to_repo(repo1, a); |
|
1314 if(set_session_config(sn, a)) { |
|
1315 return -1; |
|
1316 } |
|
1317 set_session_lock(sn, a); |
|
1318 |
|
1319 DavBool override = cmd_getoption(a, "override") ? true : false; |
|
1320 |
1313 char *url2 = a->argv[1]; |
1321 char *url2 = a->argv[1]; |
1314 char *path2 = NULL; |
1322 char *path2 = NULL; |
1315 Repository *repo2 = url2repo(url2, &path2); |
1323 Repository *repo2 = url2repo(url2, &path2); |
1316 |
|
1317 DavSession *sn = connect_to_repo(repo1, a); |
|
1318 if(set_session_config(sn, a)) { |
|
1319 return -1; |
|
1320 } |
|
1321 set_session_lock(sn, a); |
|
1322 |
|
1323 DavBool override = cmd_getoption(a, "override") ? true : false; |
|
1324 |
1324 |
1325 if(repo1 == repo2) { |
1325 if(repo1 == repo2) { |
1326 DavResource *res = dav_resource_new(sn, path1); |
1326 DavResource *res = dav_resource_new(sn, path1); |
1327 int err = cp ? dav_copy_o(res, path2, override) |
1327 int err = cp ? dav_copy_o(res, path2, override) |
1328 : dav_move_o(res, path2, override); |
1328 : dav_move_o(res, path2, override); |