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.
This commit is contained in:
Joey Hess 2011-03-19 18:58:49 -04:00
parent 54c39d09ba
commit 140a351fc5
33 changed files with 46 additions and 37 deletions

View file

@ -61,13 +61,20 @@ data Command = Command {
cmdname :: String,
cmdparams :: String,
cmdseek :: [CommandSeek],
cmddesc :: String
cmddesc :: String,
cmdusesrepo :: Bool
}
repoCommand :: String -> String -> [CommandSeek] -> String -> Command
repoCommand n p s d = Command n p s d True
standaloneCommand :: String -> String -> [CommandSeek] -> String -> Command
standaloneCommand n p s d = Command n p s d False
{- Prepares a list of actions to run to perform a command, based on
- the parameters passed to it. -}
prepCmd :: Command -> [String] -> Annex [Annex Bool]
prepCmd Command { cmdseek = seek } params = do
prepCommand :: Command -> [String] -> Annex [Annex Bool]
prepCommand Command { cmdseek = seek } params = do
lists <- mapM (\s -> s params) seek
return $ map doCommand $ concat lists