Permalink
Browse files

add --info command

  • Loading branch information...
1 parent 7e0aec0 commit 2663601a7633f2790a59163bdc98f133548cfe15 @coreyoconnor coreyoconnor committed Jul 22, 2012
Showing with 14 additions and 2 deletions.
  1. +6 −1 src/executable/Main.hs
  2. +6 −1 src/library/Yi/System/Info.hs
  3. +2 −0 test/VerifyManagementProcess.hs
View
@@ -1,3 +1,4 @@
+{-# LANGUAGE RecordWildCards #-}
-- Copyright (C) 2012 Corey O'Connor
--
-- | This process manages the compilation and execution of yi.
@@ -95,7 +96,11 @@ manageYiSystem (Init args) = do
putStr $! show yiSystemInfo
manageYiSystem Exit
ReportSystemInfo False -> do
- fail "TODO: human readable yi system info"
+ let SystemInfo {..} = yiSystemInfo
+ PackageDescription {..} = yiPackageDescription
+ LocalBuildInfo {..} = yiLocalBuildInfo
+ _ <- printf "base-version: %s\n" $ display $ pkgVersion package
+ manageYiSystem Exit
StartDelegate opts -> do
fail "TODO: Start delegate"
@@ -1,9 +1,14 @@
-- | Information about the current system used to host Yi. This includes the libraries (with exact
-- version) available and what main to use.
-module Yi.System.Info where
+module Yi.System.Info ( module Yi.System.Info
+ , module Distribution.Package
+ , module Distribution.PackageDescription
+ , module Distribution.Simple.LocalBuildInfo
+ ) where
import Yi.System.Info.Data
+import Distribution.Package
import Distribution.PackageDescription
import Distribution.Simple.LocalBuildInfo
@@ -25,5 +25,7 @@ verify_info_opts =
[ verify_stdout "raw info is parsable" ["--raw-info"] $ \out -> do
let parsed_info :: SystemInfo = read out
assert (show parsed_info == out) "raw info read/show isomorphism"
+ , verify_stdout "info is usable" ["--info"] $ \out -> do
+ assert (length out > 4) "output is not too tiny"
]

0 comments on commit 2663601

Please sign in to comment.