This commit is contained in:
Joey Hess 2011-06-02 02:40:43 -04:00
parent f2cc87860c
commit bcb72ce0f2
3 changed files with 6 additions and 9 deletions

View file

@ -28,8 +28,8 @@ import Messages
import UUID
{- Runs the passed command line. -}
dispatch :: Git.Repo -> [String] -> [Command] -> [Option] -> String -> IO ()
dispatch gitrepo args cmds options header = do
dispatch :: [String] -> [Command] -> [Option] -> String -> Git.Repo -> IO ()
dispatch args cmds options header gitrepo = do
setupConsole
state <- Annex.new gitrepo allBackends
(actions, state') <- Annex.run state $ parseCmd args header cmds options

View file

@ -113,6 +113,4 @@ header :: String
header = "Usage: git-annex command [option ..]"
run :: [String] -> IO ()
run args = do
gitrepo <- Git.repoFromCwd
dispatch gitrepo args cmds options header
run args = dispatch args cmds options header =<< Git.repoFromCwd

View file

@ -58,10 +58,9 @@ builtins :: [String]
builtins = map cmdname cmds
builtin :: String -> String -> [String] -> IO ()
builtin cmd dir params = do
dir' <- Git.repoAbsPath dir
gitrepo <- Git.repoFromAbsPath dir'
dispatch gitrepo (cmd:(filterparams params)) cmds commonOptions header
builtin cmd dir params =
Git.repoAbsPath dir >>= Git.repoFromAbsPath >>=
dispatch (cmd:(filterparams params)) cmds commonOptions header
external :: [String] -> IO ()
external params = do