version command for ghc-mod/ghc-modi.
This commit is contained in:
parent
f50e5229c4
commit
549d33d492
@ -40,6 +40,7 @@ usage = "ghc-mod version " ++ showVersion version ++ "\n"
|
||||
++ "\t ghc-mod root\n"
|
||||
++ "\t ghc-mod doc <module>\n"
|
||||
++ "\t ghc-mod boot\n"
|
||||
++ "\t ghc-mod version\n"
|
||||
++ "\t ghc-mod help\n"
|
||||
++ "\n"
|
||||
++ "<module> for \"info\" and \"type\" is not used, anything is OK.\n"
|
||||
@ -120,6 +121,7 @@ main = flip E.catches handlers $ do
|
||||
"root" -> rootInfo opt cradle
|
||||
"doc" -> nArgs 1 $ packageDoc opt cradle cmdArg1
|
||||
"boot" -> boot opt cradle
|
||||
"version" -> return $ "ghc-mod version " ++ showVersion version ++ "\n"
|
||||
"help" -> return $ O.usageInfo usage argspec
|
||||
cmd -> E.throw (NoSuchCommand cmd)
|
||||
putStr res
|
||||
|
@ -65,6 +65,7 @@ usage :: String
|
||||
usage = "ghc-modi version " ++ showVersion version ++ "\n"
|
||||
++ "Usage:\n"
|
||||
++ "\t ghc-modi [-l] [-b sep] [-g flag]\n"
|
||||
++ "\t ghc-modi version\n"
|
||||
++ "\t ghc-modi help\n"
|
||||
|
||||
parseArgs :: [OptDescr (Options -> Options)] -> [String] -> (Options, [String])
|
||||
@ -91,6 +92,7 @@ main = E.handle cmdHandler $
|
||||
where
|
||||
cmdHandler (CmdArg _) = putStr $ usageInfo usage argspec
|
||||
go (_,"help":_) = putStr $ usageInfo usage argspec
|
||||
go (_,"version":_) = putStr $ "ghc-modi version " ++ showVersion version ++ "\n"
|
||||
go (opt,_) = E.handle someHandler $ do
|
||||
cradle0 <- findCradle
|
||||
let rootdir = cradleRootDir cradle0
|
||||
|
Loading…
Reference in New Issue
Block a user