| 165 | } |
| 166 | |
| 167 | static bool checkConfig(const char *urlWithOptions) { |
| 168 | if (!urlWithOptions) { |
| 169 | return false; |
| 170 | } |
| 171 | |
| 172 | GPReader *reader = reader_init(urlWithOptions); |
| 173 | if (!reader) { |
| 174 | return false; |
| 175 | } |
| 176 | |
| 177 | ListBucketResult result = reader->getKeyList(); |
| 178 | |
| 179 | if (result.contents.empty()) { |
| 180 | fprintf(stderr, |
| 181 | "\nYour configuration works well, however there is no file matching your " |
| 182 | "prefix.\n"); |
| 183 | } else { |
| 184 | printBucketContents(result); |
| 185 | fprintf(stderr, "\nYour configuration works well.\n"); |
| 186 | } |
| 187 | |
| 188 | reader_cleanup(&reader); |
| 189 | |
| 190 | return true; |
| 191 | } |
| 192 | |
| 193 | static bool downloadS3(const char *urlWithOptions) { |
| 194 | if (!urlWithOptions) { |
no test coverage detected