git-annex/Command/Version.hs

37 lines
966 B
Haskell
Raw Normal View History

{- git-annex command
-
- Copyright 2010 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Command.Version where
2011-10-05 20:02:51 +00:00
import Common.Annex
import Command
2011-08-20 20:11:42 +00:00
import qualified Build.SysConfig as SysConfig
2011-10-04 04:40:47 +00:00
import Annex.Version
def :: [Command]
def = [oneShot $ noRepo showPackageVersion $ dontCheck repoExists $
command "version" paramNothing seek "show version info"]
seek :: [CommandSeek]
seek = [withNothing start]
start :: CommandStart
start = do
v <- getVersion
2011-10-31 20:46:51 +00:00
liftIO $ do
showPackageVersion
2011-10-31 20:46:51 +00:00
putStrLn $ "local repository version: " ++ fromMaybe "unknown" v
putStrLn $ "default repository version: " ++ defaultVersion
putStrLn $ "supported repository versions: " ++ vs supportedVersions
putStrLn $ "upgrade supported from repository versions: " ++ vs upgradableVersions
stop
where
2011-07-15 16:47:14 +00:00
vs = join " "
showPackageVersion :: IO ()
showPackageVersion = putStrLn $ "git-annex version: " ++ SysConfig.packageversion