summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Mai <l.mai@web.de>2008-01-30 00:52:58 +0100
committerLukas Mai <l.mai@web.de>2008-01-30 00:52:58 +0100
commit9615ff3cf67064456788b178f4891608f2130016 (patch)
tree8495912006a00cb5f44ad19054e25d359cd62610
parent0ecf25a244ca62fe5a0120044690e2fdced0d76a (diff)
downloadmetatile-9615ff3cf67064456788b178f4891608f2130016.tar
metatile-9615ff3cf67064456788b178f4891608f2130016.zip
add --help option
darcs-hash:20080129235258-462cf-8c2dfd926fc7e007b68730df4899dc34da1b25e4
-rw-r--r--Main.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/Main.hs b/Main.hs
index 0dd6b52..c03d22f 100644
--- a/Main.hs
+++ b/Main.hs
@@ -37,6 +37,7 @@ main = do
case args of
[] -> launch
["--resume", _] -> launch
+ ["--help"] -> usage
["--recompile"] -> recompile False >> return ()
["--recompile-force"] -> recompile True >> return ()
["--version"] -> putStrLn ("xmonad " ++ showVersion version)
@@ -45,6 +46,22 @@ main = do
#endif
_ -> fail "unrecognized flags"
+usage :: IO ()
+usage = do
+ self <- getProgName
+ putStr . unlines $
+ concat ["Usage: ", self, " [OPTION]"] :
+ "Options:" :
+ " --help Print this message" :
+ " --version Print the version number" :
+ " --recompile Recompile your ~/.xmonad/xmonad.hs if it's been changed" :
+ " --recompile-force Recompile your ~/.xmonad/xmonad.hs" :
+#ifdef TESTING
+ " --run-tests Run the test suite" :
+#endif
+ " --resume STATE Internal flag, do not use" :
+ []
+
-- | 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
-- these cases: