set oneshot mode on a per-command basis

Avoids ugly (and test suite failing) hack in Command.Version
This commit is contained in:
Joey Hess 2012-02-14 12:40:40 -04:00
parent 33e03d58ae
commit 90a8b38ac0
11 changed files with 19 additions and 16 deletions

View file

@ -11,10 +11,9 @@ import Common.Annex
import Command
import qualified Build.SysConfig as SysConfig
import Annex.Version
import CmdLine
def :: [Command]
def = [noRepo showPackageVersion $ dontCheck repoExists $
def = [oneShot $ noRepo showPackageVersion $ dontCheck repoExists $
command "version" paramNothing seek "show version info"]
seek :: [CommandSeek]
@ -29,9 +28,7 @@ start = do
putStrLn $ "default repository version: " ++ defaultVersion
putStrLn $ "supported repository versions: " ++ vs supportedVersions
putStrLn $ "upgrade supported from repository versions: " ++ vs upgradableVersions
-- avoid normal cleanup
_ <- shutdown True
liftIO exitSuccess
stop
where
vs = join " "