]> gitweb.michael.orlitzky.com - dead/htsn.git/blobdiff - src/Terminal.hs
Move FeedHosts under the TSN namespace.
[dead/htsn.git] / src / Terminal.hs
index e9b59dc4df473029f42b4bcdcc57bc85b4f49f9f..cd35bf0e08bc1c2e85083f8568054845471a5110 100644 (file)
@@ -1,6 +1,6 @@
 module Terminal (
-  hPutRedLn,
-  putGreenLn)
+  putGreenLn,
+  report_error)
 where
 
 import Control.Monad.IO.Class (MonadIO(..))
@@ -10,7 +10,7 @@ import System.Console.ANSI (
   ColorIntensity( Vivid ),
   ConsoleLayer( Foreground ),
   setSGR )
-import System.IO ( Handle, hPutStrLn )
+import System.IO ( Handle, hPutStrLn, stderr )
 
 -- | Perform a computation (anything in MonadIO) with the given
 --   graphics mode(s) enabled. Revert to the previous graphics mode
@@ -39,3 +39,7 @@ hPutRedLn h = with_color Red . hPutStrLn h
 --   consistency with e.g. putStrLn.
 putGreenLn :: String -> IO ()
 putGreenLn = with_color Green . putStrLn
+
+-- | Report an error (to stderr).
+report_error :: String -> IO ()
+report_error = hPutRedLn stderr