From 56bc3e95cabb85e5f23e30b453f90438c33efbb8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 15 May 2011 02:02:46 -0400 Subject: refactor some boilerplate --- Command.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Command.hs') diff --git a/Command.hs b/Command.hs index 9c908b800..d9e94a2f3 100644 --- a/Command.hs +++ b/Command.hs @@ -65,12 +65,22 @@ data Command = Command { cmdusesrepo :: Bool } +{- Most commands operate on files in a git repo. -} repoCommand :: String -> String -> [CommandSeek] -> String -> Command repoCommand n p s d = Command n p s d True +{- Others can run anywhere. -} standaloneCommand :: String -> String -> [CommandSeek] -> String -> Command standaloneCommand n p s d = Command n p s d False +{- For start and perform stages to indicate what step to run next. -} +next :: a -> Annex (Maybe a) +next a = return $ Just a + +{- Or to indicate nothing needs to be done. -} +stop :: Annex (Maybe a) +stop = return Nothing + {- Prepares a list of actions to run to perform a command, based on - the parameters passed to it. -} prepCommand :: Command -> [String] -> Annex [Annex Bool] -- cgit v1.2.3