mirror of https://github.com/ecmwf/eccodes.git
changed json: messages array
This commit is contained in:
parent
65cef10467
commit
e59d7f9868
|
@ -109,7 +109,7 @@ int grib_tool_init(grib_runtime_options* options)
|
|||
if (grib_options_on("d") && !grib_options_on("u"))
|
||||
options->dump_flags |= GRIB_DUMP_FLAG_ALL_DATA;
|
||||
|
||||
if (json) fprintf(stdout,"{\n");
|
||||
if (json) fprintf(stdout,"{ \"messages\" : [ \n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
|
|||
if (json) {
|
||||
grib_set_long(h,"unpack",1);
|
||||
if (options->handle_count>1) fprintf(stdout,",\n");
|
||||
fprintf(stdout,"\"message%d\" : ",options->handle_count);
|
||||
/* fprintf(stdout,"\"message%d\" : ",options->handle_count); */
|
||||
} else {
|
||||
sprintf(tmp,"MESSAGE %d ( length=%ld )",options->handle_count,length);
|
||||
if (!grib_options_on("C"))
|
||||
|
@ -185,6 +185,6 @@ void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h)
|
|||
|
||||
int grib_tool_finalise_action(grib_runtime_options* options)
|
||||
{
|
||||
if (json) fprintf(stdout,"\n}\n");
|
||||
if (json) fprintf(stdout,"\n]}\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue