From baf4fbb55cff1550d9d332f4c9a1b68d49b8a63b Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 20 Jun 2000 11:03:55 +0000 Subject: [PATCH] [project @ 2000-06-20 11:03:55 by simonmar] - print the version number as x.yy.z (i.e. replace ", patchlevel z" with ".z"), but omit the .z if z == 0. - add --numeric-version flag which prints x.yy.z without the verbage. --- ghc/driver/Main.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ghc/driver/Main.hs b/ghc/driver/Main.hs index f71ca92..ecf2fd9 100644 --- a/ghc/driver/Main.hs +++ b/ghc/driver/Main.hs @@ -70,6 +70,11 @@ long_usage = do dump ('$':'$':s) = hPutStr stderr get_prog_name >> dump s dump (c:s) = hPutChar stderr c >> dump s +version_str = _ProjectVersion ++ + ( if _ProjectPatchLevel /= "0" && _ProjectPatchLevel /= "" + then '.':_ProjectPatchLevel + else "") + ----------------------------------------------------------------------------- -- Phases @@ -1609,10 +1614,11 @@ opts = ------- version ---------------------------------------------------- - , ( "-version" , NoArg (do hPutStrLn stderr (_ProjectName - ++ ", version " ++ _ProjectVersion - ++ ", patchlevel " ++ _ProjectPatchLevel) - exitWith ExitSuccess)) + , ( "-version" , NoArg (do hPutStrLn stderr (_ProjectName + ++ ", version " ++ version_str) + exitWith ExitSuccess)) + , ( "-numeric-version", NoArg (do hPutStrLn stderr version_str + exitWith ExitSuccess)) ------- verbosity ---------------------------------------------------- , ( "v" , NoArg (writeIORef verbose True) ) -- 1.7.10.4