summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@ing.unitn.it>2008-03-18 11:18:58 +0100
committerAndrea Rossato <andrea.rossato@ing.unitn.it>2008-03-18 11:18:58 +0100
commit220420553c4d82f9ad1466cb485d91a7dddd18f1 (patch)
treef0c85bdf52671a55f4ac0ace60587695b1b32f21
parentdf87494f2ba54544612f842d116b544f5e677595 (diff)
downloadxmobar-220420553c4d82f9ad1466cb485d91a7dddd18f1.tar.gz
xmobar-220420553c4d82f9ad1466cb485d91a7dddd18f1.tar.bz2
Automate version generation
darcs-hash:20080318101858-d6583-e7b948d5683a6cab390626d7874a6dabfa3a9ae5.gz
-rw-r--r--Main.hs11
1 files 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 = "<andrea.rossato@unibz.it>\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