diff --git a/tools/grib_ls.c b/tools/grib_ls.c index 803af4932..1a10e687d 100644 --- a/tools/grib_ls.c +++ b/tools/grib_ls.c @@ -89,12 +89,6 @@ int grib_tool_init(grib_runtime_options* options) json_latlon=1; } - /* TODO: sort when JSON is on */ - if (grib_options_on("j") && grib_options_on("B:")) { - fprintf(stderr, "Error: -j and -B options are incompatible\n"); - exit(1); - } - if (options->latlon) { lat = strtod(options->latlon,&theEnd); diff --git a/tools/grib_tools.c b/tools/grib_tools.c index 4d24161b3..be72c174a 100644 --- a/tools/grib_tools.c +++ b/tools/grib_tools.c @@ -186,7 +186,6 @@ int grib_tool(int argc, char **argv) if (global_options.dump_filename) fclose(dump_file); return ret; - } static int grib_tool_with_orderby(grib_runtime_options* options) @@ -249,7 +248,10 @@ static int grib_tool_with_orderby(grib_runtime_options* options) continue; } - grib_print_header(options,h); + if (options->json_output == 0) + grib_print_header(options,h); + else + grib_tools_set_print_keys(options,h,options->name_space); grib_skip_check(options,h);