summaryrefslogtreecommitdiff
path: root/CmdLine.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-13 21:28:47 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-13 21:28:47 -0400
commitb1607485168e851f69fe3a5b74d73f3c36edf886 (patch)
tree496133383a3aa77ecc373c383c6655e50d71f9c9 /CmdLine.hs
parente5c1db355f5fa31af14ed8474aee89872b934f1a (diff)
use a state monad
enormous reworking
Diffstat (limited to 'CmdLine.hs')
-rw-r--r--CmdLine.hs21
1 files changed, 11 insertions, 10 deletions
diff --git a/CmdLine.hs b/CmdLine.hs
index 9da2b6493..d23508aa2 100644
--- a/CmdLine.hs
+++ b/CmdLine.hs
@@ -6,7 +6,8 @@
module CmdLine (
argvToMode,
- dispatch
+ dispatch,
+ Mode
) where
import System.Console.GetOpt
@@ -39,13 +40,13 @@ argvToMode argv = do
(_,files,errs) -> ioError (userError (concat errs ++ usageInfo header options))
where header = "Usage: git-annex [mode] file"
-dispatch :: State -> Mode -> FilePath -> IO ()
-dispatch state mode item = do
+dispatch :: Mode -> FilePath -> Annex ()
+dispatch mode item = do
case (mode) of
- Add -> annexFile state item
- Push -> annexPushRepo state item
- Pull -> annexPullRepo state item
- Want -> annexWantFile state item
- Get -> annexGetFile state item
- Drop -> annexDropFile state item
- Unannex -> unannexFile state item
+ Add -> annexFile item
+ Push -> annexPushRepo item
+ Pull -> annexPullRepo item
+ Want -> annexWantFile item
+ Get -> annexGetFile item
+ Drop -> annexDropFile item
+ Unannex -> unannexFile item