From 1f1a2cbe5b26fe94f98bd3ff9167f9b52abe8424 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 17 Jul 2020 15:37:57 +0100 Subject: [PATCH] Tools: Rename of common variables --- tools/bufr_compare.c | 12 +++++------ tools/bufr_copy.c | 8 ++++---- tools/bufr_dump.c | 14 ++++++------- tools/bufr_filter.c | 10 ++++----- tools/bufr_get.c | 8 ++++---- tools/bufr_index_build.c | 10 ++++----- tools/bufr_ls.c | 8 ++++---- tools/bufr_set.c | 8 ++++---- tools/codes_count.c | 14 ++++++------- tools/deprecated/grib_convert.c | 6 +++--- tools/deprecated/grib_debug.c | 6 +++--- tools/deprecated/grib_keys.c | 6 +++--- tools/deprecated/grib_points.c | 8 ++++---- tools/grib_compare.c | 8 ++++---- tools/grib_copy.c | 10 ++++----- tools/grib_dump.c | 12 +++++------ tools/grib_filter.c | 10 ++++----- tools/grib_get.c | 12 +++++------ tools/grib_get_data.c | 8 ++++---- tools/grib_histogram.c | 8 ++++---- tools/grib_index_build.c | 10 ++++----- tools/grib_ls.c | 12 +++++------ tools/grib_merge.c | 6 +++--- tools/grib_options.c | 28 ++++++++++++------------- tools/grib_set.c | 8 ++++---- tools/grib_to_netcdf.c | 36 ++++++++++++++++----------------- tools/grib_tools.c | 4 ++-- tools/grib_tools.h | 8 ++++---- tools/gts_compare.c | 6 +++--- tools/gts_copy.c | 6 +++--- tools/gts_dump.c | 8 ++++---- tools/gts_filter.c | 6 +++--- tools/gts_get.c | 6 +++--- tools/gts_ls.c | 6 +++--- tools/metar_compare.c | 6 +++--- tools/metar_copy.c | 6 +++--- tools/metar_dump.c | 8 ++++---- tools/metar_filter.c | 6 +++--- tools/metar_get.c | 6 +++--- tools/metar_ls.c | 6 +++--- tools/taf_dump.c | 8 ++++---- tools/taf_filter.c | 6 +++--- tools/taf_get.c | 6 +++--- tools/taf_ls.c | 6 +++--- 44 files changed, 200 insertions(+), 200 deletions(-) diff --git a/tools/bufr_compare.c b/tools/bufr_compare.c index 0babb11cd..0768d37c5 100644 --- a/tools/bufr_compare.c +++ b/tools/bufr_compare.c @@ -236,14 +236,14 @@ static int counter = 0; static int start = -1; static int end = -1; -const char* grib_tool_description = +const char* tool_description = "Compare BUFR messages contained in two files." "\n\tIf some differences are found it fails returning an error code." "\n\tFloating-point values are compared exactly by default, different tolerance can be defined see -P -A -R." "\n\tDefault behaviour: absolute error=0, bit-by-bit compare, same order in files."; -const char* grib_tool_name = "bufr_compare"; -const char* grib_tool_usage = "[options] bufr_file1 bufr_file2"; +const char* tool_name = "bufr_compare"; +const char* tool_usage = "[options] bufr_file1 bufr_file2"; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); @@ -326,7 +326,7 @@ int grib_tool_init(grib_runtime_options* options) } /* Check 1st file is not a directory */ - exit_if_input_is_directory(grib_tool_name, options->infile_extra->name); + exit_if_input_is_directory(tool_name, options->infile_extra->name); if (grib_options_on("r")) { char* filename[1]; @@ -388,7 +388,7 @@ int grib_tool_init(grib_runtime_options* options) if (grib_options_on("R:")) { char* sarg = grib_options_get_option("R:"); options->tolerance_count = MAX_KEYS; - ret = parse_keyval_string(grib_tool_name, sarg, 1, GRIB_TYPE_DOUBLE, options->tolerance, &(options->tolerance_count)); + ret = parse_keyval_string(tool_name, sarg, 1, GRIB_TYPE_DOUBLE, options->tolerance, &(options->tolerance_count)); if (ret == GRIB_INVALID_ARGUMENT) { usage(); exit(1); @@ -426,7 +426,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { - exit_if_input_is_directory(grib_tool_name, file->name); + exit_if_input_is_directory(tool_name, file->name); return 0; } diff --git a/tools/bufr_copy.c b/tools/bufr_copy.c index 56edaa81a..cc8dedc19 100644 --- a/tools/bufr_copy.c +++ b/tools/bufr_copy.c @@ -15,12 +15,12 @@ #include "grib_tools.h" -const char* grib_tool_description = +const char* tool_description = "Copies the content of BUFR files printing" " values of some keys." "\n\tIf the name of the output_bufr_file contains a key enclosed in square brackets, its value will be used."; -const char* grib_tool_name = "bufr_copy"; -const char* grib_tool_usage = "[options] bufr_file bufr_file ... output_bufr_file"; +const char* tool_name = "bufr_copy"; +const char* tool_usage = "[options] bufr_file bufr_file ... output_bufr_file"; grib_option grib_options[] = { /* {id, args, help}, on, command_line, value */ @@ -90,7 +90,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { - exit_if_input_is_directory(grib_tool_name, file->name); + exit_if_input_is_directory(tool_name, file->name); return 0; } diff --git a/tools/bufr_dump.c b/tools/bufr_dump.c index bb9b82677..b438b6b52 100644 --- a/tools/bufr_dump.c +++ b/tools/bufr_dump.c @@ -62,9 +62,9 @@ grib_option grib_options[] = { /* {"x",0,0,0,1,0} */ }; -const char* grib_tool_description = "Dump the content of a BUFR file in different formats."; -const char* grib_tool_name = "bufr_dump"; -const char* grib_tool_usage = "[options] bufr_file bufr_file ..."; +const char* tool_description = "Dump the content of a BUFR file in different formats."; +const char* tool_name = "bufr_dump"; +const char* tool_usage = "[options] bufr_file bufr_file ..."; static int json = 0; static int dump_descriptors = 0; static char* json_option = 0; @@ -108,7 +108,7 @@ int grib_tool_init(grib_runtime_options* options) options->strict = 1; /* Must set here as bufr_dump has its own -S option */ if (opt > 1) { - printf("%s: simultaneous j/C/O options not allowed\n", grib_tool_name); + printf("%s: simultaneous j/C/O options not allowed\n", tool_name); exit(1); } @@ -116,7 +116,7 @@ int grib_tool_init(grib_runtime_options* options) options->dump_mode = "json"; json_option = grib_options_get_option("j:"); if (strlen(json_option) > 1 || (json_option[0] != 's' && json_option[0] != 'f' && json_option[0] != 'a')) { - printf("%s: Invalid JSON option %s\n", grib_tool_name, json_option); + printf("%s: Invalid JSON option %s\n", tool_name, json_option); exit(1); } json = 1; @@ -188,7 +188,7 @@ int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* fi return 0; Assert(file); - exit_if_input_is_directory(grib_tool_name, file->name); + exit_if_input_is_directory(tool_name, file->name); /* * Dumping of index files @@ -201,7 +201,7 @@ int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* fi err = grib_index_dump_file(stdout, filename); if (err) { grib_context_log(c, GRIB_LOG_ERROR, "%s: Could not dump index file \"%s\".\n%s\n", - grib_tool_name, + tool_name, filename, grib_get_error_message(err)); exit(1); diff --git a/tools/bufr_filter.c b/tools/bufr_filter.c index 37db191d8..bf6d9dd06 100644 --- a/tools/bufr_filter.c +++ b/tools/bufr_filter.c @@ -30,12 +30,12 @@ grib_option grib_options[] = { { "7", 0, 0, 0, 1, 0 }, { "v", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description = +const char* tool_description = "Apply the rules defined in rules_file to each BUFR " "message\n\tin the BUFR files provided as arguments.\n\t" "If you specify '-' (a single dash) for the rules_file, the rules will be read from standard input."; -const char* grib_tool_name = "bufr_filter"; -const char* grib_tool_usage = +const char* tool_name = "bufr_filter"; +const char* tool_usage = "[options] rules_file " "bufr_file bufr_file ..."; @@ -75,7 +75,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { - exit_if_input_is_directory(grib_tool_name, file->name); + exit_if_input_is_directory(tool_name, file->name); return 0; } @@ -112,7 +112,7 @@ int grib_tool_finalise_action(grib_runtime_options* options) int err = 0; grib_file_close_all(&err); if (err != GRIB_SUCCESS) { - perror(grib_tool_name); + perror(tool_name); exit(err); } diff --git a/tools/bufr_get.c b/tools/bufr_get.c index 8e35a819d..73bfce41a 100644 --- a/tools/bufr_get.c +++ b/tools/bufr_get.c @@ -35,12 +35,12 @@ grib_option grib_options[] = { { "v", 0, 0, 1, 0, 0 } }; -const char* grib_tool_description = +const char* tool_description = "Get values of some header keys from a BUFR file." "\n\tIt is similar to bufr_ls, but fails returning an error code " "\n\twhen an error occurs (e.g. key not found)."; -const char* grib_tool_name = "bufr_get"; -const char* grib_tool_usage = "[options] file file ..."; +const char* tool_name = "bufr_get"; +const char* tool_usage = "[options] file file ..."; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); @@ -71,7 +71,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { - exit_if_input_is_directory(grib_tool_name, file->name); + exit_if_input_is_directory(tool_name, file->name); return 0; } diff --git a/tools/bufr_index_build.c b/tools/bufr_index_build.c index 7e564ce91..59d075568 100644 --- a/tools/bufr_index_build.c +++ b/tools/bufr_index_build.c @@ -15,11 +15,11 @@ #include "grib_tools.h" -const char* grib_tool_description = +const char* tool_description = "Build an index file for a set of input BUFR files.\n" "\tWarning: THIS TOOL IS NOT YET IMPLEMENTED"; -const char* grib_tool_name = "bufr_index_build"; -const char* grib_tool_usage = "[options] file file ... "; +const char* tool_name = "bufr_index_build"; +const char* tool_usage = "[options] file file ... "; grib_index* idx = NULL; char* keys; char* default_keys = "mars"; @@ -86,7 +86,7 @@ int grib_tool_init(grib_runtime_options* options) int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { int ret = 0; - printf("--- %s: processing %s\n", grib_tool_name, file); + printf("--- %s: processing %s\n", tool_name, file); ret = grib_index_add_file(idx, file); if (ret) { printf("error: %s\n", grib_get_error_message(ret)); @@ -124,7 +124,7 @@ int grib_tool_finalise_action(grib_runtime_options* options) grib_index_compress(idx); } printf("--- %s: keys included in the index file %s:\n", - grib_tool_name, options->outfile->name); + tool_name, options->outfile->name); printf("--- "); first = 1; the_keys = idx->keys; diff --git a/tools/bufr_ls.c b/tools/bufr_ls.c index 8ba250f49..52b98e3ec 100644 --- a/tools/bufr_ls.c +++ b/tools/bufr_ls.c @@ -37,12 +37,12 @@ grib_option grib_options[] = { { "v", 0, 0, 1, 0, 0 } }; -const char* grib_tool_description = +const char* tool_description = "List content of BUFR files printing values of " "some header keys.\n\tOnly scalar keys can be printed." "\n\tIt does not fail when a key is not found."; -const char* grib_tool_name = "bufr_ls"; -const char* grib_tool_usage = "[options] bufr_file bufr_file ..."; +const char* tool_name = "bufr_ls"; +const char* tool_usage = "[options] bufr_file bufr_file ..."; static int first_handle = 1; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); @@ -84,7 +84,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { - exit_if_input_is_directory(grib_tool_name, file->name); + exit_if_input_is_directory(tool_name, file->name); return 0; } diff --git a/tools/bufr_set.c b/tools/bufr_set.c index abddf5dc5..caf0c0547 100644 --- a/tools/bufr_set.c +++ b/tools/bufr_set.c @@ -42,12 +42,12 @@ grib_option grib_options[] = { { "v", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description = +const char* tool_description = "Sets key/value pairs in the input BUFR file and writes" "\n\teach message to the output_file." "\n\tIt fails when an error occurs (e.g. key not found)."; -const char* grib_tool_name = "bufr_set"; -const char* grib_tool_usage = "[options] file file ... output_file"; +const char* tool_name = "bufr_set"; +const char* tool_usage = "[options] file file ... output_file"; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); @@ -166,7 +166,7 @@ int grib_tool_finalise_action(grib_runtime_options* options) int err = 0; grib_file_close_all(&err); if (err != GRIB_SUCCESS) { - perror(grib_tool_name); + perror(tool_name); exit(err); } diff --git a/tools/codes_count.c b/tools/codes_count.c index beb5763b9..ff92c59f4 100644 --- a/tools/codes_count.c +++ b/tools/codes_count.c @@ -11,7 +11,7 @@ #include "grib_api_internal.h" static int fail_on_error = 1; -static const char* tool_name = NULL; +static const char* toolname = NULL; static void usage(const char* prog) { @@ -81,15 +81,15 @@ int main(int argc, char* argv[]) unsigned long count_total = 0, count_curr = 0; int message_type = 0; /* GRIB, BUFR etc */ - tool_name = argv[0]; + toolname = argv[0]; if (argc < 2) - usage(tool_name); + usage(toolname); - if (strstr(tool_name, "grib_count")) + if (strstr(toolname, "grib_count")) message_type = CODES_GRIB; - if (strstr(tool_name, "bufr_count")) + if (strstr(toolname, "bufr_count")) message_type = CODES_BUFR; - if (strstr(tool_name, "gts_count")) + if (strstr(toolname, "gts_count")) message_type = CODES_GTS; count_total = 0; @@ -104,7 +104,7 @@ int main(int argc, char* argv[]) } filename = argv[i]; if (path_is_directory(filename)) { - fprintf(stderr, "%s: ERROR: \"%s\": Is a directory\n", tool_name, filename); + fprintf(stderr, "%s: ERROR: \"%s\": Is a directory\n", toolname, filename); continue; } diff --git a/tools/deprecated/grib_convert.c b/tools/deprecated/grib_convert.c index 68f1fd80c..f6fd74e47 100644 --- a/tools/deprecated/grib_convert.c +++ b/tools/deprecated/grib_convert.c @@ -32,14 +32,14 @@ grib_option grib_options[]={ {"v",0,0,0,1,0} }; -char* grib_tool_description= +char* tool_description= "It converts grib messages applying the rules from a conversion_rules file." "\n\tThe rules are of the type \"keyname = value;\" and if blocks are allowed as" "\n\tif ( keyname1 == value1 || keyname2 != value2 && keyname3 == value3 ) {" "\n\t keyname4 = value4;" "\n\t}"; -char* grib_tool_name="grib_convert"; -char* grib_tool_usage="[options] conversion_rules " +char* tool_name="grib_convert"; +char* tool_usage="[options] conversion_rules " "grib_file grib_file ... output_grib_file"; int grib_options_count=sizeof(grib_options)/sizeof(grib_option); diff --git a/tools/deprecated/grib_debug.c b/tools/deprecated/grib_debug.c index bd0af3057..4794fb652 100644 --- a/tools/deprecated/grib_debug.c +++ b/tools/deprecated/grib_debug.c @@ -29,9 +29,9 @@ grib_option grib_options[]={ {"q",0,0,1,0,0} }; -char* grib_tool_description="Dump the content of a grib file in debug mode."; -char* grib_tool_name="grib_debug"; -char* grib_tool_usage="[options] grib_file grib_file ..."; +char* tool_description="Dump the content of a grib file in debug mode."; +char* tool_name="grib_debug"; +char* tool_usage="[options] grib_file grib_file ..."; int grib_options_count=sizeof(grib_options)/sizeof(grib_option); diff --git a/tools/deprecated/grib_keys.c b/tools/deprecated/grib_keys.c index d7b5e6482..f4229e6a3 100644 --- a/tools/deprecated/grib_keys.c +++ b/tools/deprecated/grib_keys.c @@ -29,10 +29,10 @@ grib_option grib_options[]={ {"a",0,0,0,1,0} }; -char* grib_tool_description="Lists the keys available for a type of grib (-T option) or \n" +char* tool_description="Lists the keys available for a type of grib (-T option) or \n" "\tin a grib message from a file (-F option)."; -char* grib_tool_name="grib_keys"; -char* grib_tool_usage="[options]"; +char* tool_name="grib_keys"; +char* tool_usage="[options]"; char name[1024]; int grib_options_count=sizeof(grib_options)/sizeof(grib_option); diff --git a/tools/deprecated/grib_points.c b/tools/deprecated/grib_points.c index 7e756df31..834f12a08 100644 --- a/tools/deprecated/grib_points.c +++ b/tools/deprecated/grib_points.c @@ -34,9 +34,9 @@ grib_option grib_options[]={ {"v",0,0,1,0,0} }; -char* grib_tool_description="Lat lon values list for given points list. "; -char* grib_tool_name="grib_points"; -char* grib_tool_usage="file_list_of_points grib_file grib_file ..."; +char* tool_description="Lat lon values list for given points list. "; +char* tool_name="grib_points"; +char* tool_usage="file_list_of_points grib_file grib_file ..."; int grib_options_count=sizeof(grib_options)/sizeof(grib_option); double lat=0; @@ -79,7 +79,7 @@ int grib_tool_init(grib_runtime_options* options) { } else if (*end1 == '1') { options->latlon_mode=1; } else { - printf("ERROR %s: wrong mode given in option -l\n",grib_tool_name); + printf("ERROR %s: wrong mode given in option -l\n",tool_name); exit(1); } } diff --git a/tools/grib_compare.c b/tools/grib_compare.c index dfefcdda0..9af9b8c9c 100644 --- a/tools/grib_compare.c +++ b/tools/grib_compare.c @@ -165,14 +165,14 @@ static int global_counter = 0; static int theStart = -1; static int theEnd = -1; -const char* grib_tool_description = +const char* tool_description = "Compare GRIB messages contained in two files." "\n\tIf some differences are found it fails returning an error code." "\n\tFloating-point values are compared exactly by default, different tolerance can be defined see -P -A -R." "\n\tDefault behaviour: absolute error=0, bit-by-bit compare, same order in files."; -const char* grib_tool_name = "grib_compare"; -const char* grib_tool_usage = "[options] grib_file1 grib_file2"; +const char* tool_name = "grib_compare"; +const char* tool_usage = "[options] grib_file1 grib_file2"; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); @@ -319,7 +319,7 @@ int grib_tool_init(grib_runtime_options* options) if (grib_options_on("R:")) { char* sarg = grib_options_get_option("R:"); options->tolerance_count = MAX_KEYS; - ret = parse_keyval_string(grib_tool_name, sarg, 1, GRIB_TYPE_DOUBLE, options->tolerance, &(options->tolerance_count)); + ret = parse_keyval_string(tool_name, sarg, 1, GRIB_TYPE_DOUBLE, options->tolerance, &(options->tolerance_count)); if (ret == GRIB_INVALID_ARGUMENT) { usage(); exit(1); diff --git a/tools/grib_copy.c b/tools/grib_copy.c index ebed96068..974bb4550 100644 --- a/tools/grib_copy.c +++ b/tools/grib_copy.c @@ -15,12 +15,12 @@ #include "grib_tools.h" -const char* grib_tool_description = +const char* tool_description = "Copies the content of GRIB files printing" " values of some keys." "\n\tIf the name of the output_grib_file contains a key enclosed in square brackets, its value will be used."; -const char* grib_tool_name = "grib_copy"; -const char* grib_tool_usage = "[options] grib_file grib_file ... output_grib_file"; +const char* tool_name = "grib_copy"; +const char* tool_usage = "[options] grib_file grib_file ... output_grib_file"; grib_option grib_options[] = { /* {id, args, help}, on, command_line, value */ @@ -94,7 +94,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { - exit_if_input_is_directory(grib_tool_name, file->name); + exit_if_input_is_directory(tool_name, file->name); return 0; } @@ -145,7 +145,7 @@ int grib_tool_finalise_action(grib_runtime_options* options) int err = 0; grib_file_close_all(&err); if (err != GRIB_SUCCESS) { - perror(grib_tool_name); + perror(tool_name); exit(err); } /* if (options->outfile->file) diff --git a/tools/grib_dump.c b/tools/grib_dump.c index 42398e7ad..dce8fba64 100644 --- a/tools/grib_dump.c +++ b/tools/grib_dump.c @@ -39,9 +39,9 @@ grib_option grib_options[] = { { "x", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description = "Dump the content of a GRIB file in different formats."; -const char* grib_tool_name = "grib_dump"; -const char* grib_tool_usage = "[options] grib_file grib_file ..."; +const char* tool_description = "Dump the content of a GRIB file in different formats."; +const char* tool_name = "grib_dump"; +const char* tool_usage = "[options] grib_file grib_file ..."; static int json = 0; static int first_handle = 1; static int dump_keys = 0; @@ -69,7 +69,7 @@ int grib_tool_init(grib_runtime_options* options) options->dump_mode = "default"; if (opt > 1) { - printf("%s: simultaneous j/O/D options not allowed\n", grib_tool_name); + printf("%s: simultaneous j/O/D options not allowed\n", tool_name); exit(1); } @@ -130,7 +130,7 @@ int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* fi return 0; Assert(file); - exit_if_input_is_directory(grib_tool_name, file->name); + exit_if_input_is_directory(tool_name, file->name); sprintf(tmp, "FILE: %s ", options->current_infile->name); if (!grib_options_on("C")) @@ -147,7 +147,7 @@ int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* fi err = grib_index_dump_file(stdout, filename); if (err) { grib_context_log(c, GRIB_LOG_ERROR, "%s: Could not dump index file \"%s\".\n%s\n", - grib_tool_name, + tool_name, filename, grib_get_error_message(err)); exit(1); diff --git a/tools/grib_filter.c b/tools/grib_filter.c index 839ab3795..1734c6c0a 100644 --- a/tools/grib_filter.c +++ b/tools/grib_filter.c @@ -26,12 +26,12 @@ grib_option grib_options[] = { { "7", 0, 0, 0, 1, 0 }, { "v", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description = +const char* tool_description = "Apply the rules defined in rules_file to each GRIB " "message\n\tin the GRIB files provided as arguments.\n\t" "If you specify '-' (a single dash) for the rules_file, the rules will be read from standard input."; -const char* grib_tool_name = "grib_filter"; -const char* grib_tool_usage = +const char* tool_name = "grib_filter"; +const char* tool_usage = "[options] rules_file " "grib_file grib_file ..."; @@ -68,7 +68,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { - exit_if_input_is_directory(grib_tool_name, file->name); + exit_if_input_is_directory(tool_name, file->name); return 0; } @@ -105,7 +105,7 @@ int grib_tool_finalise_action(grib_runtime_options* options) int err = 0; grib_file_close_all(&err); if (err != GRIB_SUCCESS) { - perror(grib_tool_name); + perror(tool_name); exit(err); } diff --git a/tools/grib_get.c b/tools/grib_get.c index c82240c37..5c9340a6b 100644 --- a/tools/grib_get.c +++ b/tools/grib_get.c @@ -35,12 +35,12 @@ grib_option grib_options[] = { { "i:", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description = +const char* tool_description = "Get values of some keys from a GRIB file." "\n\tIt is similar to grib_ls, but fails returning an error code " "\n\twhen an error occurs (e.g. key not found)."; -const char* grib_tool_name = "grib_get"; -const char* grib_tool_usage = "[options] grib_file grib_file ..."; +const char* tool_name = "grib_get"; +const char* tool_usage = "[options] grib_file grib_file ..."; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); static double lat = 0; @@ -75,7 +75,7 @@ int grib_tool_init(grib_runtime_options* options) if (options->latlon) { lat = strtod(options->latlon, &theEnd); if (*theEnd != ',') { - fprintf(stderr, "Error %s: wrong latitude value. Please use 'latitude,longitude'\n",grib_tool_name); + fprintf(stderr, "Error %s: wrong latitude value. Please use 'latitude,longitude'\n",tool_name); exit(1); } lon = strtod(++theEnd, &end1); @@ -95,7 +95,7 @@ int grib_tool_init(grib_runtime_options* options) options->latlon_mode = 1; } else { - fprintf(stderr, "Error %s: wrong mode given in option -l\n", grib_tool_name); + fprintf(stderr, "Error %s: wrong mode given in option -l\n", tool_name); exit(1); } } @@ -162,7 +162,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { - exit_if_input_is_directory(grib_tool_name, file->name); + exit_if_input_is_directory(tool_name, file->name); if (nearest) grib_nearest_delete(nearest); nearest = NULL; diff --git a/tools/grib_get_data.c b/tools/grib_get_data.c index 9a042d32b..61db62751 100644 --- a/tools/grib_get_data.c +++ b/tools/grib_get_data.c @@ -39,11 +39,11 @@ grib_option grib_options[] = { { "V", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description = +const char* tool_description = "Print a latitude, longitude, data values list.\n" "\tNote: Rotated grids are first unrotated"; -const char* grib_tool_name = "grib_get_data"; -const char* grib_tool_usage = "[options] grib_file grib_file ..."; +const char* tool_name = "grib_get_data"; +const char* tool_usage = "[options] grib_file grib_file ..."; extern FILE* dump_file; @@ -71,7 +71,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { - exit_if_input_is_directory(grib_tool_name, file->name); + exit_if_input_is_directory(tool_name, file->name); return 0; } diff --git a/tools/grib_histogram.c b/tools/grib_histogram.c index 9d6c8a585..a3bd610d1 100644 --- a/tools/grib_histogram.c +++ b/tools/grib_histogram.c @@ -19,9 +19,9 @@ grib_option grib_options[] = { }; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -const char* grib_tool_description = "Histogram of GRIB files"; -const char* grib_tool_name = "grib_histogram"; -const char* grib_tool_usage = "[options] grib_file grib_file ..."; +const char* tool_description = "Histogram of GRIB files"; +const char* tool_name = "grib_histogram"; +const char* tool_usage = "[options] grib_file grib_file ..."; int main(int argc, char* argv[]) { @@ -45,7 +45,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { - exit_if_input_is_directory(grib_tool_name, file->name); + exit_if_input_is_directory(tool_name, file->name); return 0; } diff --git a/tools/grib_index_build.c b/tools/grib_index_build.c index 96ffc9e4b..37df60244 100644 --- a/tools/grib_index_build.c +++ b/tools/grib_index_build.c @@ -15,9 +15,9 @@ #include "grib_tools.h" -const char* grib_tool_description = "Build an index file for a set of input GRIB files."; -const char* grib_tool_name = "grib_index_build"; -const char* grib_tool_usage = "[options] grib_file grib_file ... "; +const char* tool_description = "Build an index file for a set of input GRIB files."; +const char* tool_name = "grib_index_build"; +const char* tool_usage = "[options] grib_file grib_file ... "; static grib_index* idx = NULL; static char* keys; static char* default_keys = "mars"; @@ -83,7 +83,7 @@ int grib_tool_init(grib_runtime_options* options) int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { int ret = 0; - printf("--- %s: processing %s\n", grib_tool_name, file); + printf("--- %s: processing %s\n", tool_name, file); ret = grib_index_add_file(idx, file); if (ret) { printf("error: %s\n", grib_get_error_message(ret)); @@ -121,7 +121,7 @@ int grib_tool_finalise_action(grib_runtime_options* options) grib_index_compress(idx); } printf("--- %s: keys included in the index file %s:\n", - grib_tool_name, options->outfile->name); + tool_name, options->outfile->name); printf("--- "); first = 1; the_keys = idx->keys; diff --git a/tools/grib_ls.c b/tools/grib_ls.c index c307e8ed1..a78ef103e 100644 --- a/tools/grib_ls.c +++ b/tools/grib_ls.c @@ -42,11 +42,11 @@ grib_option grib_options[] = { { "x", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description = +const char* tool_description = "List content of GRIB files printing values of " "some keys.\n\tIt does not fail when a key is not found."; -const char* grib_tool_name = "grib_ls"; -const char* grib_tool_usage = "[options] grib_file grib_file ..."; +const char* tool_name = "grib_ls"; +const char* tool_usage = "[options] grib_file grib_file ..."; static char* new_handle = ""; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); @@ -100,7 +100,7 @@ int grib_tool_init(grib_runtime_options* options) if (options->latlon) { lat = strtod(options->latlon, &theEnd); if (*theEnd != ',') { - fprintf(stderr, "Error %s: wrong latitude value. Please use 'latitude,longitude'\n",grib_tool_name); + fprintf(stderr, "Error %s: wrong latitude value. Please use 'latitude,longitude'\n",tool_name); exit(1); } lon = strtod(++theEnd, &end1); @@ -120,7 +120,7 @@ int grib_tool_init(grib_runtime_options* options) options->latlon_mode = 1; } else { - fprintf(stderr, "Error %s: wrong mode given in option -l\n", grib_tool_name); + fprintf(stderr, "Error %s: wrong mode given in option -l\n", tool_name); exit(1); } } @@ -208,7 +208,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { - exit_if_input_is_directory(grib_tool_name, file->name); + exit_if_input_is_directory(tool_name, file->name); if (nearest) grib_nearest_delete(nearest); nearest = NULL; diff --git a/tools/grib_merge.c b/tools/grib_merge.c index d54a7dadb..16ee48c0f 100644 --- a/tools/grib_merge.c +++ b/tools/grib_merge.c @@ -34,9 +34,9 @@ int key_values_size = MAX_KEY_VALUES; * tool to identify the fields to be merged */ static const char* md5Key = "md5Product"; -const char* grib_tool_description = "Merge two fields with identical parameters and different geographical area"; -const char* grib_tool_name = "grib_merge"; -const char* grib_tool_usage = "[options] file file ... output_file"; +const char* tool_description = "Merge two fields with identical parameters and different geographical area"; +const char* tool_name = "grib_merge"; +const char* tool_usage = "[options] file file ... output_file"; grib_option grib_options[] = { /* {id, args, help}, on, command_line, value */ diff --git a/tools/grib_options.c b/tools/grib_options.c index 09c4f1cf6..b47503175 100644 --- a/tools/grib_options.c +++ b/tools/grib_options.c @@ -118,9 +118,9 @@ static int grib_options_help_count = sizeof(grib_options_help_list) / sizeof(gri void usage(void) { int i = 0; - printf("\nNAME \t%s\n\n", grib_tool_name); - printf("DESCRIPTION\n\t%s\n\n", grib_tool_description); - printf("USAGE \n\t%s %s\n\n", grib_tool_name, grib_tool_usage); + printf("\nNAME \t%s\n\n", tool_name); + printf("DESCRIPTION\n\t%s\n\n", tool_description); + printf("USAGE \n\t%s %s\n\n", tool_name, tool_usage); printf("OPTIONS\n"); for (i = 0; i < grib_options_count; i++) { if (grib_options[i].command_line) @@ -333,7 +333,7 @@ int grib_process_runtime_options(grib_context* context, int argc, char** argv, g } options->requested_print_keys_count = MAX_KEYS; - ret = parse_keyval_string(grib_tool_name, karg, 0, GRIB_TYPE_UNDEFINED, + ret = parse_keyval_string(tool_name, karg, 0, GRIB_TYPE_UNDEFINED, options->requested_print_keys, &(options->requested_print_keys_count)); if (ret == GRIB_INVALID_ARGUMENT) usage(); @@ -360,7 +360,7 @@ int grib_process_runtime_options(grib_context* context, int argc, char** argv, g if (grib_options_on("s:")) { sarg = grib_options_get_option("s:"); options->set_values_count = MAX_KEYS; - ret = parse_keyval_string(grib_tool_name, sarg, 1, GRIB_TYPE_UNDEFINED, options->set_values, &(options->set_values_count)); + ret = parse_keyval_string(tool_name, sarg, 1, GRIB_TYPE_UNDEFINED, options->set_values, &(options->set_values_count)); if (ret == GRIB_INVALID_ARGUMENT) usage(); } @@ -368,7 +368,7 @@ int grib_process_runtime_options(grib_context* context, int argc, char** argv, g if (grib_options_on("b:")) { barg = grib_options_get_option("b:"); options->set_values_count = MAX_KEYS; - ret = parse_keyval_string(grib_tool_name, barg, 0, GRIB_TYPE_STRING, options->set_values, &(options->set_values_count)); + ret = parse_keyval_string(tool_name, barg, 0, GRIB_TYPE_STRING, options->set_values, &(options->set_values_count)); if (ret == GRIB_INVALID_ARGUMENT) usage(); } @@ -376,7 +376,7 @@ int grib_process_runtime_options(grib_context* context, int argc, char** argv, g if (grib_options_on("c:")) { sarg = grib_options_get_option("c:"); options->compare_count = MAX_KEYS; - ret = parse_keyval_string(grib_tool_name, sarg, 0, GRIB_TYPE_UNDEFINED, options->compare, + ret = parse_keyval_string(tool_name, sarg, 0, GRIB_TYPE_UNDEFINED, options->compare, &(options->compare_count)); if (ret == GRIB_INVALID_ARGUMENT) usage(); @@ -392,7 +392,7 @@ int grib_process_runtime_options(grib_context* context, int argc, char** argv, g warg = grib_options_get_option("w:"); options->constraints_count = MAX_KEYS; - ret = parse_keyval_string(grib_tool_name, warg, 1, GRIB_TYPE_UNDEFINED, + ret = parse_keyval_string(tool_name, warg, 1, GRIB_TYPE_UNDEFINED, options->constraints, &(options->constraints_count)); if (ret == GRIB_INVALID_ARGUMENT) usage(); @@ -458,9 +458,9 @@ char* grib_options_get_args(char* id) void usage_doxygen(void) { int i = 0; - printf("/*! \\page %s %s\n", grib_tool_name, grib_tool_name); - printf("\\section DESCRIPTION \n %s\n\n", grib_tool_description); - printf("\\section USAGE \n %s \n %s\n\n", grib_tool_name, grib_tool_usage); + printf("/*! \\page %s %s\n", tool_name, tool_name); + printf("\\section DESCRIPTION \n %s\n\n", tool_description); + printf("\\section USAGE \n %s \n %s\n\n", tool_name, tool_usage); printf("\\section OPTIONS \n"); for (i = 0; i < grib_options_count; i++) { if (grib_options[i].command_line) { @@ -477,9 +477,9 @@ void usage_doxygen(void) #if 0 void usage_doxygen(void) { int i=0; - printf("/*! \\page %s %s\n",grib_tool_name,grib_tool_name); - printf("\\section DESCRIPTION \n%s\n\n",grib_tool_description); - printf("\\section USAGE \n%s \n%s\n\n",grib_tool_name,grib_tool_usage); + printf("/*! \\page %s %s\n",tool_name,tool_name); + printf("\\section DESCRIPTION \n%s\n\n",tool_description); + printf("\\section USAGE \n%s \n%s\n\n",tool_name,tool_usage); printf("\\section OPTIONS\n"); printf("\n"); for (i=0;i #endif -const char* grib_tool_description = +const char* tool_description = "Convert a GRIB file to netCDF format." "\n\tNote: The GRIB geometry should be a regular lat/lon grid or a regular Gaussian grid" "\n\t(the key \"typeOfGrid\" should be \"regular_ll\" or \"regular_gg\")"; -const char* grib_tool_name = "grib_to_netcdf"; -const char* grib_tool_usage = "[options] grib_file grib_file ... "; +const char* tool_name = "grib_to_netcdf"; +const char* tool_usage = "[options] grib_file grib_file ... "; static char argvString[2048] = {0,}; /*=====================================================================*/ @@ -2143,9 +2143,9 @@ static nc_type translate_nctype(const char* name) static void check_err(const char* function, const int stat, const int line) { if (stat != NC_NOERR) { - /* (void) fprintf(stderr, "line %d of %s: %s\n", line, grib_tool_name, nc_strerror(stat)); */ + /* (void) fprintf(stderr, "line %d of %s: %s\n", line, tool_name, nc_strerror(stat)); */ (void)fprintf(stderr, "\n%s ERROR: line %d, %s: %s\n", - grib_tool_name, line, function, nc_strerror(stat)); + tool_name, line, function, nc_strerror(stat)); if (stat == NC_EVARSIZE) { (void)fprintf(stderr, "\nCannot create netCDF classic format, dataset is too large!\n" @@ -3062,7 +3062,7 @@ static int define_netcdf_dimensions(hypercube* h, fieldset* fs, int ncid, datase dims[i] = n - i - 1; for (i = 0; i < subsetcnt; ++i) { - printf("%s: Defining variable '%s'.\n", grib_tool_name, subsets[i].att.name); + printf("%s: Defining variable '%s'.\n", tool_name, subsets[i].att.name); stat = nc_def_var(ncid, subsets[i].att.name, subsets[i].att.nctype, n, dims, &var_id); check_err("nc_def_var", stat, __LINE__); @@ -3351,7 +3351,7 @@ static void print_ignored_keys(FILE* f, request* data) int i = 0; while ((ignore = get_value(data, "ignore", i)) != NULL) { if (i == 0) { - fprintf(f, "%s: Ignoring key(s): %s", grib_tool_name, ignore); + fprintf(f, "%s: Ignoring key(s): %s", tool_name, ignore); } else { fprintf(f, ", %s", ignore); @@ -3861,25 +3861,25 @@ static int get_creation_mode(int option_kind) int creation_mode = NC_CLOBBER; switch (option_kind) { case NC_FORMAT_CLASSIC: - printf("%s: Creating classic file format.\n", grib_tool_name); + printf("%s: Creating classic file format.\n", tool_name); break; case NC_FORMAT_64BIT: creation_mode |= NC_64BIT_OFFSET; - printf("%s: Creating large (64 bit) file format.\n", grib_tool_name); + printf("%s: Creating large (64 bit) file format.\n", tool_name); break; #ifdef NC_NETCDF4 case NC_FORMAT_NETCDF4: creation_mode |= NC_NETCDF4; - printf("%s: Creating netCDF-4/HDF5 format.\n", grib_tool_name); + printf("%s: Creating netCDF-4/HDF5 format.\n", tool_name); break; case NC_FORMAT_NETCDF4_CLASSIC: creation_mode |= NC_NETCDF4 | NC_CLASSIC_MODEL; - printf("%s: Creating netCDF-4 classic model file format.\n", grib_tool_name); + printf("%s: Creating netCDF-4 classic model file format.\n", tool_name); break; #else case NC_FORMAT_NETCDF4: case NC_FORMAT_NETCDF4_CLASSIC: - grib_context_log(ctx, GRIB_LOG_ERROR, "%s not built with netcdf4, cannot create netCDF-4 files.", grib_tool_name); + grib_context_log(ctx, GRIB_LOG_ERROR, "%s not built with netcdf4, cannot create netCDF-4 files.", tool_name); exit(1); break; #endif @@ -3993,7 +3993,7 @@ int grib_tool_init(grib_runtime_options* options) data_r = empty_request(0); user_r = empty_request(0); - printf("%s: Version ", grib_tool_name); + printf("%s: Version ", tool_name); grib_print_api_version(stdout); printf("\n"); @@ -4128,7 +4128,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil grib_handle* h = NULL; grib_file* file = NULL; - printf("%s: Processing input file '%s'.\n", grib_tool_name, filename); + printf("%s: Processing input file '%s'.\n", tool_name, filename); file = grib_file_open(filename, "r", &e); if (!file || !file->handle) @@ -4280,7 +4280,7 @@ int grib_tool_finalise_action(grib_runtime_options* options) return -1; } - printf("%s: Found %d GRIB field%s in %d file%s.\n", grib_tool_name, fs->count, fs->count > 1 ? "s" : "", files, files > 1 ? "s" : ""); + printf("%s: Found %d GRIB field%s in %d file%s.\n", tool_name, fs->count, fs->count > 1 ? "s" : "", files, files > 1 ? "s" : ""); if (ctx->debug) { grib_context_log(ctx, GRIB_LOG_INFO, "Request representing %d fields ", fs->count); @@ -4304,8 +4304,8 @@ int grib_tool_finalise_action(grib_runtime_options* options) /* Create netcdf file */ - printf("%s: Creating netCDF file '%s'\n", grib_tool_name, options->outfile->name); - printf("%s: NetCDF library version: %s\n", grib_tool_name, nc_inq_libvers()); + printf("%s: Creating netCDF file '%s'\n", tool_name, options->outfile->name); + printf("%s: NetCDF library version: %s\n", tool_name, nc_inq_libvers()); creation_mode = get_creation_mode(option_kind); stat = nc_create(options->outfile->name, creation_mode, &ncid); @@ -4354,7 +4354,7 @@ int grib_tool_finalise_action(grib_runtime_options* options) free_subsets(subsets, count); free_nc_options(); - printf("%s: Done.\n", grib_tool_name); + printf("%s: Done.\n", tool_name); return 0; } diff --git a/tools/grib_tools.c b/tools/grib_tools.c index 100b63d02..8a5a4142a 100644 --- a/tools/grib_tools.c +++ b/tools/grib_tools.c @@ -1352,10 +1352,10 @@ void grib_tools_write_message(grib_runtime_options* options, grib_handle* h) } #endif } -int exit_if_input_is_directory(const char* tool_name, const char* filename) +int exit_if_input_is_directory(const char* toolname, const char* filename) { if (path_is_directory(filename)) { - fprintf(stderr, "%s: ERROR: \"%s\": Is a directory\n", tool_name, filename); + fprintf(stderr, "%s: ERROR: \"%s\": Is a directory\n", toolname, filename); exit(1); } return 0; diff --git a/tools/grib_tools.h b/tools/grib_tools.h index 7690b648f..f16ec8b96 100644 --- a/tools/grib_tools.h +++ b/tools/grib_tools.h @@ -174,9 +174,9 @@ typedef struct grib_runtime_options extern grib_option grib_options[]; extern int grib_options_count; -extern const char* grib_tool_name; -extern const char* grib_tool_description; -extern const char* grib_tool_usage; +extern const char* tool_name; +extern const char* tool_description; +extern const char* tool_usage; extern FILE* dump_file; @@ -206,6 +206,6 @@ int grib_process_runtime_options(grib_context* c, int argc, char** argv, grib_ru void grib_tools_write_message(grib_runtime_options* options, grib_handle* h); int grib_tool_new_filename_action(grib_runtime_options* options, const char* file); int grib_no_handle_action(grib_runtime_options* options, int err); -int exit_if_input_is_directory(const char* tool_name, const char* filename); +int exit_if_input_is_directory(const char* toolname, const char* filename); #endif diff --git a/tools/gts_compare.c b/tools/gts_compare.c index 024a80e96..a4fcd0caf 100644 --- a/tools/gts_compare.c +++ b/tools/gts_compare.c @@ -131,13 +131,13 @@ int counter = 0; int start = -1; int end = -1; -const char* grib_tool_description = +const char* tool_description = "Compare GTS messages contained in two files." "\n\tIf some differences are found it fails returning an error code." "\n\tDefault behaviour: bit-by-bit compare, same order in files."; -const char* grib_tool_name = "gts_compare"; -const char* grib_tool_usage = +const char* tool_name = "gts_compare"; +const char* tool_usage = "[options] " "file file"; diff --git a/tools/gts_copy.c b/tools/gts_copy.c index fdc870b9c..2edc55bd5 100644 --- a/tools/gts_copy.c +++ b/tools/gts_copy.c @@ -10,11 +10,11 @@ #include "grib_tools.h" -const char* grib_tool_description = +const char* tool_description = "Copies the content of GTS files printing" " values of some keys."; -const char* grib_tool_name = "gts_copy"; -const char* grib_tool_usage = "[options] file file ... output_file"; +const char* tool_name = "gts_copy"; +const char* tool_usage = "[options] file file ... output_file"; grib_option grib_options[] = { /* {id, args, help}, on, command_line, value */ diff --git a/tools/gts_dump.c b/tools/gts_dump.c index eb8a02094..13b302c80 100644 --- a/tools/gts_dump.c +++ b/tools/gts_dump.c @@ -33,9 +33,9 @@ grib_option grib_options[] = { { "x", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description = "Dump the content of a GTS file in different formats."; -const char* grib_tool_name = "gts_dump"; -const char* grib_tool_usage = "[options] file file ..."; +const char* tool_description = "Dump the content of a GTS file in different formats."; +const char* tool_name = "gts_dump"; +const char* tool_usage = "[options] file file ..."; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); @@ -62,7 +62,7 @@ int grib_tool_init(grib_runtime_options* options) if (opt > 1) { - printf("%s: simultaneous O/D options not allowed\n", grib_tool_name); + printf("%s: simultaneous O/D options not allowed\n", tool_name); exit(1); } diff --git a/tools/gts_filter.c b/tools/gts_filter.c index 8a4dd9537..8c5223e79 100644 --- a/tools/gts_filter.c +++ b/tools/gts_filter.c @@ -26,12 +26,12 @@ grib_option grib_options[] = { { "7", 0, 0, 0, 1, 0 }, { "v", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description = +const char* tool_description = "Apply the rules defined in rules_file to each GTS " "message\n\tin the GTS files provided as arguments.\n\t" "If you specify '-' (a single dash) for the rules_file, the rules will be read from standard input."; -const char* grib_tool_name = "gts_filter"; -const char* grib_tool_usage = +const char* tool_name = "gts_filter"; +const char* tool_usage = "[options] rules_file " "file file ..."; int fail = 0; diff --git a/tools/gts_get.c b/tools/gts_get.c index 14f91c6a4..e7a1db6fd 100644 --- a/tools/gts_get.c +++ b/tools/gts_get.c @@ -28,12 +28,12 @@ grib_option grib_options[] = { { "v", 0, 0, 1, 0, 0 } }; -const char* grib_tool_description = +const char* tool_description = "Get values of some keys from a GTS file." "\n\tIt is similar to gts_ls, but fails returning an error code " "\n\twhen an error occurs (e.g. key not found)."; -const char* grib_tool_name = "gts_get"; -const char* grib_tool_usage = "[options] file file ..."; +const char* tool_name = "gts_get"; +const char* tool_usage = "[options] file file ..."; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); int mode = 0; diff --git a/tools/gts_ls.c b/tools/gts_ls.c index 04bba3595..e8d68b478 100644 --- a/tools/gts_ls.c +++ b/tools/gts_ls.c @@ -32,11 +32,11 @@ grib_option grib_options[] = { { "v", 0, 0, 1, 0, 0 } }; -const char* grib_tool_description = +const char* tool_description = "List content of GTS files printing values of " "some keys.\n\tIt does not fail when a key is not found."; -const char* grib_tool_name = "gts_ls"; -const char* grib_tool_usage = "[options] file file ..."; +const char* tool_name = "gts_ls"; +const char* tool_usage = "[options] file file ..."; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); int mode = 0; diff --git a/tools/metar_compare.c b/tools/metar_compare.c index 9af1c9d28..1e0a8f6d0 100644 --- a/tools/metar_compare.c +++ b/tools/metar_compare.c @@ -194,14 +194,14 @@ int global_counter = 0; int start = -1; int end = -1; -const char* grib_tool_description = +const char* tool_description = "Compare METAR messages contained in two files." "\n\tIf some differences are found it fails returning an error code." "\n\tFloating-point values are compared exactly by default, different tolerance can be defined see -P -A -R." "\n\tDefault behaviour: absolute error=0, bit-by-bit compare, same order in files."; -const char* grib_tool_name = "metar_compare"; -const char* grib_tool_usage = +const char* tool_name = "metar_compare"; +const char* tool_usage = "[options] " "file file"; diff --git a/tools/metar_copy.c b/tools/metar_copy.c index 714a29337..a8bed2211 100644 --- a/tools/metar_copy.c +++ b/tools/metar_copy.c @@ -10,11 +10,11 @@ #include "grib_tools.h" -const char* grib_tool_description = +const char* tool_description = "Copies the content of METAR files printing" " values of some keys."; -const char* grib_tool_name = "metar_copy"; -const char* grib_tool_usage = "[options] file file ... output_file"; +const char* tool_name = "metar_copy"; +const char* tool_usage = "[options] file file ... output_file"; grib_option grib_options[] = { /* {id, args, help}, on, command_line, value */ diff --git a/tools/metar_dump.c b/tools/metar_dump.c index 577068d7b..1c496c5a8 100644 --- a/tools/metar_dump.c +++ b/tools/metar_dump.c @@ -36,9 +36,9 @@ grib_option grib_options[] = { { "x", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description = "Dump the content of a METAR file in different formats."; -const char* grib_tool_name = "metar_dump"; -const char* grib_tool_usage = "[options] file file ..."; +const char* tool_description = "Dump the content of a METAR file in different formats."; +const char* tool_name = "metar_dump"; +const char* tool_usage = "[options] file file ..."; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); @@ -59,7 +59,7 @@ int grib_tool_init(grib_runtime_options* options) options->dump_mode = "default"; if (opt > 1) { - printf("%s: simultaneous O/D options not allowed\n", grib_tool_name); + printf("%s: simultaneous O/D options not allowed\n", tool_name); exit(1); } diff --git a/tools/metar_filter.c b/tools/metar_filter.c index 97db49d4c..bbf3306c0 100644 --- a/tools/metar_filter.c +++ b/tools/metar_filter.c @@ -24,11 +24,11 @@ grib_option grib_options[] = { { "7", 0, 0, 0, 1, 0 }, { "v", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description = +const char* tool_description = "Apply the rules defined in rules_file to each METAR " "message\n\tin the files provided as arguments."; -const char* grib_tool_name = "metar_filter"; -const char* grib_tool_usage = +const char* tool_name = "metar_filter"; +const char* tool_usage = "[options] rules_file " "file file ..."; int fail = 0; diff --git a/tools/metar_get.c b/tools/metar_get.c index e2ae92f8f..2508034ba 100644 --- a/tools/metar_get.c +++ b/tools/metar_get.c @@ -29,12 +29,12 @@ grib_option grib_options[] = { { "v", 0, 0, 1, 0, 0 } }; -const char* grib_tool_description = +const char* tool_description = "Get values of some keys from a METAR file." "\n\tIt is similar to metar_ls, but fails returning an error code " "\n\twhen an error occurs (e.g. key not found)."; -const char* grib_tool_name = "metar_get"; -const char* grib_tool_usage = "[options] file file ..."; +const char* tool_name = "metar_get"; +const char* tool_usage = "[options] file file ..."; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); double lat = 0; diff --git a/tools/metar_ls.c b/tools/metar_ls.c index c23acb7f9..8d795b7b9 100644 --- a/tools/metar_ls.c +++ b/tools/metar_ls.c @@ -44,11 +44,11 @@ grib_option grib_options[] = { /*{"x",0,0,0,1,0}*/ }; -const char* grib_tool_description = +const char* tool_description = "List content of METAR files printing values of " "some keys.\n\tIt does not fail when a key is not found."; -const char* grib_tool_name = "metar_ls"; -const char* grib_tool_usage = "[options] file file ..."; +const char* tool_name = "metar_ls"; +const char* tool_usage = "[options] file file ..."; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); double lat = 0; diff --git a/tools/taf_dump.c b/tools/taf_dump.c index 6e37b15ef..a6cdb704e 100644 --- a/tools/taf_dump.c +++ b/tools/taf_dump.c @@ -29,9 +29,9 @@ grib_option grib_options[] = { { "x", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description = "Dump the content of a TAF file in different formats."; -const char* grib_tool_name = "taf_dump"; -const char* grib_tool_usage = "[options] file file ..."; +const char* tool_description = "Dump the content of a TAF file in different formats."; +const char* tool_name = "taf_dump"; +const char* tool_usage = "[options] file file ..."; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); @@ -53,7 +53,7 @@ int grib_tool_init(grib_runtime_options* options) if (opt > 1) { - printf("%s: simultaneous C/O/D options not allowed\n", grib_tool_name); + printf("%s: simultaneous C/O/D options not allowed\n", tool_name); exit(1); } diff --git a/tools/taf_filter.c b/tools/taf_filter.c index c94b6dd17..148d5b1c9 100644 --- a/tools/taf_filter.c +++ b/tools/taf_filter.c @@ -26,11 +26,11 @@ grib_option grib_options[] = { { "7", 0, 0, 0, 1, 0 }, { "v", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description = +const char* tool_description = "Apply the rules defined in rules_file to each TAF " "message\n\tin the files provided as arguments."; -const char* grib_tool_name = "taf_filter"; -const char* grib_tool_usage = +const char* tool_name = "taf_filter"; +const char* tool_usage = "[options] rules_file " "file file ..."; int fail = 0; diff --git a/tools/taf_get.c b/tools/taf_get.c index 44567f8e0..de1c66078 100644 --- a/tools/taf_get.c +++ b/tools/taf_get.c @@ -33,12 +33,12 @@ grib_option grib_options[] = { { "i:", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description = +const char* tool_description = "Get values of some keys from a TAF file." "\n\tIt is similar to taf_ls, but fails returning an error code " "\n\twhen an error occurs (e.g. key not found)."; -const char* grib_tool_name = "taf_get"; -const char* grib_tool_usage = "[options] file file ..."; +const char* tool_name = "taf_get"; +const char* tool_usage = "[options] file file ..."; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); int mode = 0; diff --git a/tools/taf_ls.c b/tools/taf_ls.c index c640f90a1..ad0a2ff92 100644 --- a/tools/taf_ls.c +++ b/tools/taf_ls.c @@ -37,11 +37,11 @@ grib_option grib_options[] = { { "x", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description = +const char* tool_description = "List content of TAF files printing values of " "some keys.\n\tIt does not fail when a key is not found."; -const char* grib_tool_name = "taf_ls"; -const char* grib_tool_usage = "[options] file file ..."; +const char* tool_name = "taf_ls"; +const char* tool_usage = "[options] file file ..."; int grib_options_count = sizeof(grib_options) / sizeof(grib_option); double lat = 0;