From ba82ef8274e10aa65d433d7873b037a0860d8038 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Tue, 18 Jul 2017 14:11:48 -0700 Subject: [PATCH] Complain if the output file or directory is specified more than once --- main.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/main.cpp b/main.cpp index 1f55959..f24f7f6 100644 --- a/main.cpp +++ b/main.cpp @@ -2293,10 +2293,26 @@ int main(int argc, char **argv) { break; case 'o': + if (out_mbtiles != NULL) { + fprintf(stderr, "%s: Can't specify both %s and %s as output\n", argv[0], out_mbtiles, optarg); + exit(EXIT_FAILURE); + } + if (out_directory != NULL) { + fprintf(stderr, "%s: Can't specify both %s and %s as output\n", argv[0], out_directory, optarg); + exit(EXIT_FAILURE); + } out_mbtiles = optarg; break; case 'e': + if (out_mbtiles != NULL) { + fprintf(stderr, "%s: Can't specify both %s and %s as output\n", argv[0], out_mbtiles, optarg); + exit(EXIT_FAILURE); + } + if (out_directory != NULL) { + fprintf(stderr, "%s: Can't specify both %s and %s as output\n", argv[0], out_directory, optarg); + exit(EXIT_FAILURE); + } out_directory = optarg; break;