From 2cb0219c418585ee123d97d812db4d89dda7a4b8 Mon Sep 17 00:00:00 2001 From: Alessandro Pasotti Date: Wed, 24 Apr 2024 13:18:52 +0200 Subject: [PATCH] Fix after test run --- apps/gdal_contour.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/gdal_contour.cpp b/apps/gdal_contour.cpp index ec40d3906495..55e1f5a57c03 100644 --- a/apps/gdal_contour.cpp +++ b/apps/gdal_contour.cpp @@ -159,8 +159,8 @@ GDALContourAppOptionsGetParser(GDALContourOptions *psOptions) group.add_argument("-fl") .metavar("") + .nargs(argparse::nargs_pattern::at_least_one) .scan<'g', double>() - .append() .action([psOptions](const std::string &s) { psOptions->adfFixedLevels.push_back(CPLAtof(s.c_str())); }) .help(_("Name one or more \"fixed levels\" to extract.")); @@ -328,7 +328,7 @@ MAIN_START(argc, argv) /* Create the output file. */ /* -------------------------------------------------------------------- */ CPLString osFormat; - if (!sOptions.osFormat.empty()) + if (sOptions.osFormat.empty()) { const auto aoDrivers = GetOutputDriversFor( sOptions.aosDestFilename.c_str(), GDAL_OF_VECTOR); @@ -411,12 +411,12 @@ MAIN_START(argc, argv) CreateElevAttrib(sOptions.osElevAttrib.c_str(), hLayer); } - if (sOptions.osElevAttribMin.empty()) + if (!sOptions.osElevAttribMin.empty()) { CreateElevAttrib(sOptions.osElevAttribMin.c_str(), hLayer); } - if (sOptions.osElevAttribMax.empty()) + if (!sOptions.osElevAttribMax.empty()) { CreateElevAttrib(sOptions.osElevAttribMax.c_str(), hLayer); }