git-annex/Command/Version.hs
2011-10-05 16:02:51 -04:00

31 lines
880 B
Haskell

{- git-annex command
-
- Copyright 2010 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Command.Version where
import Common.Annex
import Command
import qualified Build.SysConfig as SysConfig
import Annex.Version
command :: [Command]
command = [standaloneCommand "version" paramNothing seek "show version info"]
seek :: [CommandSeek]
seek = [withNothing start]
start :: CommandStart
start = do
liftIO $ putStrLn $ "git-annex version: " ++ SysConfig.packageversion
v <- getVersion
liftIO $ putStrLn $ "local repository version: " ++ fromMaybe "unknown" v
liftIO $ putStrLn $ "default repository version: " ++ defaultVersion
liftIO $ putStrLn $ "supported repository versions: " ++ vs supportedVersions
liftIO $ putStrLn $ "upgrade supported from repository versions: " ++ vs upgradableVersions
stop
where
vs = join " "