summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-03-05 17:41:36 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-03-05 17:41:36 -0400
commitef92bd2b0bc2a85f42594e92d295230421186b72 (patch)
treeed49ee7c93eb21eba032b00e5391911fddfa2f85 /Command
parent80fdfdb72bde67977da950f70a7a058f53322ba1 (diff)
add copy count
Diffstat (limited to 'Command')
-rw-r--r--Command/Whereis.hs15
1 files changed, 10 insertions, 5 deletions
diff --git a/Command/Whereis.hs b/Command/Whereis.hs
index de5192385..5b0bcbbd2 100644
--- a/Command/Whereis.hs
+++ b/Command/Whereis.hs
@@ -12,7 +12,6 @@ import Control.Monad.State (liftIO)
import qualified Annex
import LocationLog
import Command
-import Content
import Messages
import UUID
import Types
@@ -33,9 +32,15 @@ perform :: Key -> CommandPerform
perform key = do
g <- Annex.gitRepo
uuids <- liftIO $ keyLocations g key
- pp <- prettyPrintUUIDs uuids
- showLongNote $ pp
- showProgress
+ let num = length uuids
+ showNote $ show num ++ " " ++ copiesplural num
if null $ uuids
then return Nothing
- else return $ Just $ return True
+ else do
+ pp <- prettyPrintUUIDs uuids
+ showLongNote $ pp
+ showProgress
+ return $ Just $ return True
+ where
+ copiesplural 1 = "copy"
+ copiesplural _ = "copies"