summaryrefslogtreecommitdiff
path: root/Command.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-22 15:46:57 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-22 15:46:57 -0400
commit57adb0347bf4eb71ab846a2947680a20263449a2 (patch)
treeeb9df0ec57462a2a45bf2ff0d6c1d05d5677634f /Command.hs
parentfd11b5a3e5355a68f182a60eda7916d57e141366 (diff)
hlint tweaks
Remotes.hs next, and also Backend/* and Command/*
Diffstat (limited to 'Command.hs')
-rw-r--r--Command.hs26
1 files changed, 11 insertions, 15 deletions
diff --git a/Command.hs b/Command.hs
index c6d2d0d5d..4d10a9e7f 100644
--- a/Command.hs
+++ b/Command.hs
@@ -64,17 +64,17 @@ prepSubCmd SubCommand { subcmdseek = seek } state params = do
doSubCmd :: SubCmdStart -> SubCmdCleanup
doSubCmd start = do
s <- start
- case (s) of
+ case s of
Nothing -> return True
Just perform -> do
p <- perform
- case (p) of
+ case p of
Nothing -> do
showEndFail
return False
Just cleanup -> do
c <- cleanup
- if (c)
+ if c
then do
showEndOk
return True
@@ -85,14 +85,14 @@ doSubCmd start = do
notAnnexed :: FilePath -> Annex (Maybe a) -> Annex (Maybe a)
notAnnexed file a = do
r <- Backend.lookupFile file
- case (r) of
+ case r of
Just _ -> return Nothing
Nothing -> a
isAnnexed :: FilePath -> ((Key, Backend) -> Annex (Maybe a)) -> Annex (Maybe a)
isAnnexed file a = do
r <- Backend.lookupFile file
- case (r) of
+ case r of
Just v -> a v
Nothing -> return Nothing
@@ -153,19 +153,15 @@ withNothing _ _ = return []
{- Default to acting on all files matching the seek action if
- none are specified. -}
withAll :: SubCmdSeekStrings -> SubCmdSeekStrings
-withAll w a params = do
- if null params
- then do
- g <- Annex.gitRepo
- w a [Git.workTree g]
- else w a params
+withAll w a [] = do
+ g <- Annex.gitRepo
+ w a [Git.workTree g]
+withAll w a p = w a p
{- Provides a default parameter to act on if none is specified. -}
withDefault :: String-> SubCmdSeekStrings -> SubCmdSeekStrings
-withDefault d w a params = do
- if null params
- then w a [d]
- else w a params
+withDefault d w a [] = w a [d]
+withDefault _ w a p = w a p
{- filter out files from the state directory -}
notState :: FilePath -> Bool