diff options
author | Joey Hess <joey@kitenet.net> | 2011-05-15 02:12:17 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-05-15 02:15:24 -0400 |
commit | efa7f544050c0d5be6bc1b0fc0125278e475c213 (patch) | |
tree | 840a810dc1753c63892ebfdb209dcc5fedbab896 | |
parent | 56bc3e95cabb85e5f23e30b453f90438c33efbb8 (diff) |
cleanup
-rw-r--r-- | Command.hs | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/Command.hs b/Command.hs index d9e94a2f3..0e3958c18 100644 --- a/Command.hs +++ b/Command.hs @@ -58,20 +58,20 @@ type CommandSeekNothing = CommandStart -> CommandSeek type CommandStartNothing = CommandStart data Command = Command { + cmdusesrepo :: Bool, cmdname :: String, cmdparams :: String, cmdseek :: [CommandSeek], - cmddesc :: String, - cmdusesrepo :: Bool + cmddesc :: String } {- 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 +repoCommand = Command True {- Others can run anywhere. -} standaloneCommand :: String -> String -> [CommandSeek] -> String -> Command -standaloneCommand n p s d = Command n p s d False +standaloneCommand = Command False {- For start and perform stages to indicate what step to run next. -} next :: a -> Annex (Maybe a) @@ -102,13 +102,8 @@ doCommand start = do return False Just cleanup -> do c <- cleanup - if c - then do - showEndOk - return True - else do - showEndFail - return False + if c then showEndOk else showEndFail + return c notAnnexed :: FilePath -> Annex (Maybe a) -> Annex (Maybe a) notAnnexed file a = do |