From 1f80b13600dadcf8355f2944c4789c7fb7491e24 Mon Sep 17 00:00:00 2001 From: Dmitrii Kovanikov Date: Sun, 28 Jun 2020 12:35:29 +0100 Subject: [PATCH 1/2] [#329] Add GHC version to the --version output Resolves #329 --- src/Stan/Cli.hs | 4 ++-- src/Stan/Info.hs | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Stan/Cli.hs b/src/Stan/Cli.hs index 98e916d1..1feb4ff2 100644 --- a/src/Stan/Cli.hs +++ b/src/Stan/Cli.hs @@ -36,7 +36,7 @@ import Stan.Category (Category (..)) import Stan.Config (Check (..), CheckFilter (..), CheckType (..), ConfigP (..), PartialConfig, Scope (..)) import Stan.Core.Id (Id (..)) -import Stan.Info (prettyStanVersion, stanVersion) +import Stan.Info (prettyStanVersion, stanVersion, stanSystem) import Stan.Inspection (Inspection) import Stan.Observation (Observation) import Stan.Report.Settings (ReportSettings (..), ToggleSolution (..), Verbosity (..)) @@ -317,7 +317,7 @@ scopeP = -- | Show the version of the tool. versionP :: Parser (a -> a) -versionP = infoOption (prettyStanVersion stanVersion) +versionP = infoOption (prettyStanVersion stanVersion stanSystem) $ long "version" <> short 'v' <> help "Show Stan's version" diff --git a/src/Stan/Info.hs b/src/Stan/Info.hs index 295f72b3..cc78e430 100644 --- a/src/Stan/Info.hs +++ b/src/Stan/Info.hs @@ -51,11 +51,12 @@ stanVersion = StanVersion {- | Colourful pretty 'StanVersion' representation used in the @CLI@. -} -prettyStanVersion :: StanVersion -> String -prettyStanVersion StanVersion{..} = toString $ intercalate "\n" +prettyStanVersion :: StanVersion -> StanSystem -> String +prettyStanVersion StanVersion{..} StanSystem{..} = toString $ intercalate "\n" [ sVersion , sHash , sDate + , sGhc ] where fmt :: String -> String @@ -65,6 +66,7 @@ prettyStanVersion StanVersion{..} = toString $ intercalate "\n" sVersion = fmt $ "Stan " <> "v" <> svVersion sHash = " ➤ " <> fmt "Git revision: " <> svGitRevision sDate = " ➤ " <> fmt "Commit date: " <> svCommitDate + sGhc = " ➤ " <> fmt "GHC version: " <> ssCompilerVersion {- | Contains all @stan@ System information -} From aad71ef9f324a38a6f9fb435ee5eee89ba619d39 Mon Sep 17 00:00:00 2001 From: Dmitrii Kovanikov Date: Sun, 28 Jun 2020 12:41:23 +0100 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ecc8b5b..7c33b126 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ The change log is available [on GitHub][2]. * [#327](https://github.com/kowainik/stan/issues/327): When the generated HIE files are incomplete (missing the source code), print `` as the source instead of failing. +* [#329](https://github.com/kowainik/stan/issues/329): + Add GHC version to the `--version` output. ## 0.0.0.0