summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-12-22 03:05:20 +0100
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-12-22 03:05:20 +0100
commit40e43a6d58b3f8ee2eb10cd1de19687324f518fa (patch)
treeaf0a657fe3323a860d96dda83584788bda29f1d8
parent69e3875c8bdd0614dfed2c0580f3e1a0f7f31040 (diff)
downloadmetatile-40e43a6d58b3f8ee2eb10cd1de19687324f518fa.tar
metatile-40e43a6d58b3f8ee2eb10cd1de19687324f518fa.zip
Add support for several flags:
--version: print xmonad's version --recompile: recompile xmonad.hs if it is out of date --force-recompile: recompile xmonad.hs unconditionally darcs-hash:20071222020520-a5988-0ce148dc9bd7c5c39f54f75957fc10561f1623a0
-rw-r--r--Main.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/Main.hs b/Main.hs
index a38f697..ca34dc1 100644
--- a/Main.hs
+++ b/Main.hs
@@ -26,8 +26,15 @@ import System.Posix.Process (executeFile)
-- for xmonad, and if it doesn't find one, just launches the default.
main :: IO ()
main = do
- handle (hPrint stderr) buildLaunch
- xmonad defaultConfig -- if buildLaunch returns, execute the trusted core
+ args <- getArgs
+ let launch = handle (hPrint stderr) buildLaunch >> xmonad defaultConfig
+ case args of
+ [] -> launch
+ ["--resume", _] -> launch
+ ["--recompile"] -> recompile False
+ ["--recompile-force"] -> recompile True
+ ["--version"] -> putStrLn "xmonad 0.5"
+ _ -> fail "unrecognized flags"
-- | Build "~/.xmonad/xmonad.hs" with ghc, then execute it. If there are no
-- errors, this function does not return. An exception is raised in any of