refactor some boilerplate

This commit is contained in:
Joey Hess 2011-05-15 02:02:46 -04:00
parent b400984ddf
commit 56bc3e95ca
31 changed files with 93 additions and 86 deletions

View file

@ -26,7 +26,7 @@ seek = [withFilesInGit start]
start :: CommandStartString
start file = isAnnexed file $ \(key, _) -> do
showStart "whereis" file
return $ Just $ perform key
next $ perform key
perform :: Key -> CommandPerform
perform key = do
@ -35,12 +35,12 @@ perform key = do
let num = length uuids
showNote $ show num ++ " " ++ copiesplural num
if null $ uuids
then return Nothing
then stop
else do
pp <- prettyPrintUUIDs uuids
showLongNote $ pp
showProgress
return $ Just $ return True
next $ return True
where
copiesplural 1 = "copy"
copiesplural _ = "copies"