mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 00:20:22 -07:00
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
This commit is contained in:
parent
31c7734f7b
commit
6c72a03fb1
11
Main.hs
11
Main.hs
@ -26,8 +26,15 @@ import System.Posix.Process (executeFile)
|
|||||||
-- for xmonad, and if it doesn't find one, just launches the default.
|
-- for xmonad, and if it doesn't find one, just launches the default.
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
handle (hPrint stderr) buildLaunch
|
args <- getArgs
|
||||||
xmonad defaultConfig -- if buildLaunch returns, execute the trusted core
|
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
|
-- | 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
|
-- errors, this function does not return. An exception is raised in any of
|
||||||
|
Loading…
x
Reference in New Issue
Block a user