diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-04-25 00:21:44 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-04-25 00:21:44 -0400 |
commit | a835e9e4b410d98bcae0c0f5be485e6daac407d4 (patch) | |
tree | 86a414b3e8bc767c265da44a0f1ea5cd6b62ec4d /Session.hs | |
parent | 17d76b2a59d496a2ffd6d2199b1c6ad563b0bb5b (diff) | |
download | debug-me-a835e9e4b410d98bcae0c0f5be485e6daac407d4.tar.gz |
include "session is done" in the session transcript
Including the process exit status.
And cleaner Role.User shutdown sequence.
Diffstat (limited to 'Session.hs')
-rw-r--r-- | Session.hs | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -3,11 +3,16 @@ module Session where import qualified Data.ByteString as B +import qualified Data.ByteString.Char8 as B8 +import System.Exit +import Data.Monoid startSession :: B.ByteString startSession = ">>> debug-me session started" -sessionDone :: IO () -sessionDone = do - putStrLn "" - putStrLn ">>> debug-me session ended" +endSession :: ExitCode -> B.ByteString +endSession ec = ">>> debug-me session ended (" <> B8.pack (show n) <> ")" + where + n = case ec of + ExitSuccess -> 0 + ExitFailure c -> c |