summaryrefslogtreecommitdiff
path: root/CmdLine.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-03-19 18:58:49 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-03-19 18:58:49 -0400
commit140a351fc535235ae5714122f0c98174cbdb19ce (patch)
treeaad6d0fd91ade0b1eabc7a5d4c1eb22b9d8dbe76 /CmdLine.hs
parent54c39d09ba0185cea398876e609e59d3059b18e7 (diff)
avoid version check before running version and upgrade commands
There are two types of commands; those that access the repository and those that don't. Sorted.
Diffstat (limited to 'CmdLine.hs')
-rw-r--r--CmdLine.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/CmdLine.hs b/CmdLine.hs
index 6b4fd0f36..de03d96ed 100644
--- a/CmdLine.hs
+++ b/CmdLine.hs
@@ -45,7 +45,9 @@ parseCmd argv header cmds options = do
[] -> error $ "unknown command" ++ usagemsg
[command] -> do
_ <- sequence flags
- prepCmd command (drop 1 params)
+ when (cmdusesrepo command) $
+ checkVersion
+ prepCommand command (drop 1 params)
_ -> error "internal error: multiple matching commands"
where
getopt = case getOpt Permute options argv of
@@ -93,7 +95,6 @@ tryRun' _ errnum [] = do
startup :: Annex Bool
startup = do
prepUUID
- checkVersion
return True
{- Cleanup actions. -}