From 840af76734c4bd3e3b1e4354ab7beab791c091a7 Mon Sep 17 00:00:00 2001 From: Max Base Date: Fri, 21 Feb 2020 06:12:27 -0500 Subject: [PATCH] Add version command line option / #3735 --- lib/system.g | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/system.g b/lib/system.g index 574587fbb5..798edf4724 100644 --- a/lib/system.g +++ b/lib/system.g @@ -60,6 +60,7 @@ BIND_GLOBAL( "GAPInfo", rec( # for those options is correct CommandLineOptionData := [ rec( short:= "h", long := "help", default := false, help := ["print this help and exit"] ), + rec( short:= "v", long := "version", default := false, help := ["print the version and exit"] ), rec( short:= "b", long := "banner", default := false, help := ["disable/enable the banner"] ), rec( short:= "q", long := "quiet", default := false, help := ["enable/disable quiet mode"] ), rec( short:= "e", default := false, help := ["disable/enable quitting on -D"] ), @@ -480,6 +481,13 @@ CallAndInstallPostRestore( function() " Default actions are indicated first.\n", "\n" ); QUIT_GAP(); + elif GAPInfo.CommandLineOptions.v then + PRINT_TO( "*errout*", + "KernelVersion ", GAPInfo.KernelVersion, "\n", + "BuildVersion ", GAPInfo.BuildVersion, "\n", + "\n" ); + # PRINT_TO( "*errout*",GAPInfo.KernelVersion); + QUIT_GAP(); fi; end );