aboutsummaryrefslogtreecommitdiff
path: root/Remote.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-29 22:11:01 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-29 22:11:01 -0400
commit895b068e350977cec1e31d49bd87b13b0a5676d9 (patch)
tree33e302e0b8c94d0bdf91ffddb03f9f18f57de043 /Remote.hs
parent675ad9fe226e99ca9ee2defa7ba6b0489123f0dc (diff)
tweak intro
Diffstat (limited to 'Remote.hs')
-rw-r--r--Remote.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/Remote.hs b/Remote.hs
index bb582778f..ac9da0536 100644
--- a/Remote.hs
+++ b/Remote.hs
@@ -129,14 +129,19 @@ prettyPrintUUIDs desc uuids = do
, ("here", toJSON $ hereu == u)
]
-{- List of remote names and/or descriptions, for human display.
- - Omits the current repisitory. -}
+{- List of remote names and/or descriptions, for human display. -}
prettyListUUIDs :: [UUID] -> Annex [String]
prettyListUUIDs uuids = do
hereu <- getUUID
m <- uuidDescriptions
- return $ map (\u -> M.findWithDefault "" u m) $
- filter (/= hereu) uuids
+ return $ map (\u -> prettify m hereu u) uuids
+ where
+ finddescription m u = M.findWithDefault "" u m
+ prettify m hereu u
+ | u == hereu = addName n "here"
+ | otherwise = n
+ where
+ n = finddescription m u
{- Filters a list of remotes to ones that have the listed uuids. -}
remotesWithUUID :: [Remote] -> [UUID] -> [Remote]