Clean up output indentation
@@ -842,9 +842,17 @@ static void get_value_for_key(grib_handle* h, const char* key_name, int key_type
sprintf(value_str,"MISSING");
return;
}
+ if (ret == GRIB_NOT_FOUND) {
+ sprintf(value_str,"not_found");
+ return;
+ }
if (type == GRIB_TYPE_UNDEFINED) {
- grib_get_native_type(h, key_name, &type);
+ ret=grib_get_native_type(h, key_name, &type);
+ if(ret!=GRIB_SUCCESS) {
+ fprintf(dump_file,"Could not determine type for %s\n", key_name);
+ exit(1);
+ }
}
if (type == GRIB_TYPE_STRING) {
@@ -962,7 +970,7 @@ void grib_print_key_values(grib_runtime_options* options, grib_handle* h)
else
fprintf(dump_file,"\n");
}
- fprintf(dump_file, "}\n");
+ fprintf(dump_file, " }");
return;
}
