diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-10-24 21:18:51 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-10-24 21:18:51 +0200 |
| commit | 32f92851c0028e1ff6d5203d34c7ded1ffe1951a (patch) | |
| tree | 2ee862400a71b3b87275dc2915a623fbb2d3d9ad /src/apps | |
| parent | 4e95a04f1b841eac6fa6b2beb1c86f059aaa587c (diff) | |
| download | PROJ-32f92851c0028e1ff6d5203d34c7ded1ffe1951a.tar.gz PROJ-32f92851c0028e1ff6d5203d34c7ded1ffe1951a.zip | |
projsync: fix --list-files to be compatible with filtering options
Diffstat (limited to 'src/apps')
| -rw-r--r-- | src/apps/projsync.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/apps/projsync.cpp b/src/apps/projsync.cpp index 8e6ac96b..7f3d5e56 100644 --- a/src/apps/projsync.cpp +++ b/src/apps/projsync.cpp @@ -238,7 +238,7 @@ int main(int argc, char *argv[]) { endpoint.resize(endpoint.size() - 1); } - if (!quiet) { + if (!quiet && !listFiles) { std::cout << "Downloading from " << endpoint << " into " << targetDir << std::endl; } @@ -344,12 +344,6 @@ int main(int argc, char *argv[]) { } } - if (listFiles) { - std::cout << name << "," << area_of_use << "," << source_id - << "," << file_size << std::endl; - continue; - } - const bool matchSourceId = queryAll || queriedSourceId.empty() || source_id.find(queriedSourceId) != std::string::npos; @@ -479,7 +473,14 @@ int main(int argc, char *argv[]) { } while (false); } - if (matchFile & matchSourceId && matchAreaOfUse && matchBbox) { + if (matchFile && matchSourceId && matchAreaOfUse && matchBbox) { + + if (listFiles) { + std::cout << name << "," << area_of_use << "," << source_id + << "," << file_size << std::endl; + continue; + } + const std::string resource_url(endpoint + '/' + name); if (proj_is_download_needed(ctx, resource_url.c_str(), false)) { total_size_to_download += file_size; @@ -493,7 +494,7 @@ int main(int argc, char *argv[]) { } } - if (!quiet && total_size_to_download > 0) { + if (!quiet && !listFiles && total_size_to_download > 0) { if (total_size_to_download > 1024 * 1024) std::cout << "Total size to download: " << total_size_to_download / (1024 * 1024) << " MB" |
