From 2f4935b49689028a74b74c6ba755a0cec05f90b5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 2 Nov 2022 17:55:47 +0000 Subject: [PATCH] Tools: Add option to display the library version --- tools/grib_check_gaussian_grid.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/grib_check_gaussian_grid.c b/tools/grib_check_gaussian_grid.c index 30f4b833c..9b1150ffe 100644 --- a/tools/grib_check_gaussian_grid.c +++ b/tools/grib_check_gaussian_grid.c @@ -35,12 +35,13 @@ static int DBL_EQUAL(double d1, double d2, double tolerance) static void usage(const char* prog) { - printf("Usage: %s [-f] [-v] grib_file grib_file ...\n\n", prog); + printf("Usage: %s [-f] [-v] [-V] grib_file grib_file ...\n\n", prog); printf("Check geometry of GRIB fields with a Gaussian Grid.\n"); printf("(The grid is assumed to be GLOBAL)\n\n"); printf("Options:\n"); printf(" -f Do not exit on first error\n"); printf(" -v Verbose\n"); + printf(" -V Print the ecCodes version\n"); printf("\n"); exit(1); } @@ -263,6 +264,12 @@ int main(int argc, char** argv) } exit_on_error = 0; } + else if (STR_EQUAL(arg, "-V")) { + printf("\necCodes Version "); + grib_print_api_version(stdout); + printf("\n\n"); + return 0; + } else if (STR_EQUAL(arg, "-v")) { if (argc < 3) { usage(argv[0]);