summaryrefslogtreecommitdiff
path: root/Remote.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-29 21:54:23 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-29 21:54:23 -0400
commit326617ad2f6c1708bc2826ba75cb8f9c3064d6dc (patch)
tree7a0ceaab772362aecda942003c1696ca7647cba9 /Remote.hs
parent0186f06744e6c379d41c482f42374853bd3c5539 (diff)
add intro
Diffstat (limited to 'Remote.hs')
-rw-r--r--Remote.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Remote.hs b/Remote.hs
index e211ef7cb..bb582778f 100644
--- a/Remote.hs
+++ b/Remote.hs
@@ -24,6 +24,7 @@ module Remote (
uuidDescriptions,
byName,
prettyPrintUUIDs,
+ prettyListUUIDs,
remotesWithUUID,
remotesWithoutUUID,
keyLocations,
@@ -128,6 +129,15 @@ prettyPrintUUIDs desc uuids = do
, ("here", toJSON $ hereu == u)
]
+{- List of remote names and/or descriptions, for human display.
+ - Omits the current repisitory. -}
+prettyListUUIDs :: [UUID] -> Annex [String]
+prettyListUUIDs uuids = do
+ hereu <- getUUID
+ m <- uuidDescriptions
+ return $ map (\u -> M.findWithDefault "" u m) $
+ filter (/= hereu) uuids
+
{- Filters a list of remotes to ones that have the listed uuids. -}
remotesWithUUID :: [Remote] -> [UUID] -> [Remote]
remotesWithUUID rs us = filter (\r -> uuid r `elem` us) rs