From e2ae69dddfefcfb577517b1d4ad6d4d773f7e705 Mon Sep 17 00:00:00 2001 From: Oliver Heidmann <oliver.heidmann@mpimet.mpg.de> Date: Tue, 4 Feb 2025 12:45:20 +0100 Subject: [PATCH] added newlines to --config all output, CGRIBEX check now uses cdi function cdi_has_gribex --- src/cdo_features.cc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/cdo_features.cc b/src/cdo_features.cc index 37d8aa6a7..aaa1e9da8 100644 --- a/src/cdo_features.cc +++ b/src/cdo_features.cc @@ -82,12 +82,6 @@ constexpr bool have_hdf5 = true; constexpr bool have_hdf5 = false; #endif -#ifdef HAVE_LIBCGRIBEX -constexpr bool have_cgribex = true; -#else -constexpr bool have_cgribex = false; -#endif - #ifdef HAVE_LIBCMOR constexpr bool have_cmor = true; #else @@ -144,7 +138,7 @@ static std::map<std::string, std::pair<std::string, bool>> configMap { "has-nc5", { "NetCDF 5", cdiHaveFiletype(CDI_FILETYPE_NC5) } }, { "has-nczarr", { "NetCDF 4 zarr", cdiHaveFiletype(CDI_FILETYPE_NCZARR) } }, { "has-hdf5", { "HDF5", have_hdf5 } }, - { "has-cgribex", { "CGRIBEX", have_cgribex } }, + { "has-cgribex", { "CGRIBEX", cdi_has_cgribex() } }, { "has-cmor", { "CMOR", have_cmor } }, { "has-magics", { "MAGICS", have_magics } }, { "has-openmp", { "OPENMP", have_openmp } }, @@ -379,14 +373,14 @@ print_config(std::string const &option) if ("all-json" == option || "all" == option) { - std::cout << "{"; + std::cout << "{\n"; int i = 0; for (auto const &entry : configMap) { - if (i++) fprintf(stdout, ","); + if (i++) fprintf(stdout, ",\n"); std::cout << "\"" << entry.first << "\":\"" << (entry.second.second ? "yes" : "no") << "\""; } - std::cout << "}\n"; + std::cout << "\n}\n"; } else { -- GitLab