From 220420553c4d82f9ad1466cb485d91a7dddd18f1 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Tue, 18 Mar 2008 11:18:58 +0100 Subject: Automate version generation darcs-hash:20080318101858-d6583-e7b948d5683a6cab390626d7874a6dabfa3a9ae5.gz --- Main.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Main.hs b/Main.hs index 9ac16d4..b4e0f12 100644 --- a/Main.hs +++ b/Main.hs @@ -24,8 +24,9 @@ import Parsers import Config import XUtil -import Prelude +import Paths_xmobar (version) import Data.IORef +import Data.Version (showVersion) import Graphics.X11.Xlib import System.Console.GetOpt import System.Exit @@ -115,8 +116,8 @@ usage = (usageInfo header options) ++ footer where header = "Usage: xmobar [OPTION...] [FILE]\nOptions:" footer = "\nMail bug reports and suggestions to " ++ mail -version :: String -version = "Xmobar 0.8 (C) 2007 Andrea Rossato " ++ mail ++ license +info :: String +info = "Xmobar " ++ showVersion version ++ " (C) 2007 Andrea Rossato " ++ mail ++ license mail :: String mail = "\n" @@ -131,8 +132,8 @@ doOpts :: IORef Config -> [Opts] -> IO () doOpts _ [] = return () doOpts conf (o:oo) = case o of - Help -> putStr usage >> exitWith ExitSuccess - Version -> putStrLn version >> exitWith ExitSuccess + Help -> putStr usage >> exitWith ExitSuccess + Version -> putStrLn info >> exitWith ExitSuccess Font s -> modifyIORef conf (\c -> c { font = s }) >> go BgColor s -> modifyIORef conf (\c -> c { bgColor = s }) >> go FgColor s -> modifyIORef conf (\c -> c { fgColor = s }) >> go -- cgit v1.2.3