git-annex-shell mostly done now, only needs 2 more subcommands

This commit is contained in:
Joey Hess 2010-12-30 20:08:22 -04:00
parent 7a52b34e06
commit a5a302b77d
6 changed files with 130 additions and 55 deletions

View file

@ -8,9 +8,7 @@
module CmdLine (
dispatch,
parseCmd,
Option,
storeOptBool,
storeOptString,
usage,
) where
import System.Console.GetOpt
@ -27,9 +25,8 @@ import Upgrade
import Options
{- Runs the passed command line. -}
dispatch :: [String] -> [Command] -> [Option] -> String -> IO ()
dispatch args cmds options header = do
gitrepo <- Git.repoFromCwd
dispatch :: Git.Repo -> [String] -> [Command] -> [Option] -> String -> IO ()
dispatch gitrepo args cmds options header = do
state <- Annex.new gitrepo allBackends
(actions, state') <- Annex.run state $ parseCmd args header cmds options
tryRun state' $ [startup, upgrade] ++ actions