diff options
author | Joey Hess <joey@kitenet.net> | 2011-03-19 18:58:49 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-03-19 18:58:49 -0400 |
commit | 140a351fc535235ae5714122f0c98174cbdb19ce (patch) | |
tree | aad6d0fd91ade0b1eabc7a5d4c1eb22b9d8dbe76 /Command.hs | |
parent | 54c39d09ba0185cea398876e609e59d3059b18e7 (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 'Command.hs')
-rw-r--r-- | Command.hs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Command.hs b/Command.hs index 41ad884a9..1449d7eed 100644 --- a/Command.hs +++ b/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 |