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:
parent
54c39d09ba
commit
140a351fc5
33 changed files with 46 additions and 37 deletions
13
Command.hs
13
Command.hs
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue