summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-08-24 13:40:22 +0300
committerArnold D. Robbins <arnold@skeeve.com>2012-08-24 13:40:22 +0300
commit759f2234c9bfa689151277fd2215bc0927cfc9c3 (patch)
tree90ea15331ba0d71540047385c93708bd9f966f5a /main.c
parent8970970f3f3bc3d757fe491e90e608366fb7e604 (diff)
downloadgawk-759f2234c9bfa689151277fd2215bc0927cfc9c3.tar.gz
Add facility to get vesion info from extensions.
Diffstat (limited to 'main.c')
-rw-r--r--main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/main.c b/main.c
index 9c99c86f..8ac9493e 100644
--- a/main.c
+++ b/main.c
@@ -138,6 +138,7 @@ int do_flags = false;
bool do_optimize = true; /* apply default optimizations */
static int do_nostalgia = false; /* provide a blast from the past */
static int do_binary = false; /* hands off my data! */
+static int do_version = false; /* print version info */
int use_lc_numeric = false; /* obey locale for decimal point */
@@ -180,7 +181,7 @@ static const struct option optab[] = {
{ "load", required_argument, NULL, 'l' },
{ "dump-variables", optional_argument, NULL, 'd' },
{ "assign", required_argument, NULL, 'v' },
- { "version", no_argument, NULL, 'V' },
+ { "version", no_argument, & do_version, 'V' },
{ "help", no_argument, NULL, 'h' },
{ "exec", required_argument, NULL, 'E' },
{ "use-lc-numeric", no_argument, & use_lc_numeric, 1 },
@@ -469,7 +470,7 @@ main(int argc, char **argv)
break;
case 'V':
- version();
+ do_version = true;
break;
case 'W': /* gawk specific options - now in getopt_long */
@@ -652,6 +653,10 @@ out:
have_srcfile++;
}
+ /* do version check after extensions are loaded to get extension info */
+ if (do_version)
+ version();
+
/* No -f or --source options, use next arg */
if (! have_srcfile) {
if (optind > argc - 1 || stopped_early) /* no args left or no program */
@@ -1409,6 +1414,8 @@ version()
printf(" (GNU MPFR %s, GNU MP %s)", mpfr_get_version(), gmp_version);
#endif
printf("\n");
+ print_ext_versions();
+
/*
* Per GNU coding standards, print copyright info,
* then exit successfully, do nothing else.