summaryrefslogtreecommitdiff
path: root/Command/List.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/List.hs')
-rw-r--r--Command/List.hs16
1 files changed, 7 insertions, 9 deletions
diff --git a/Command/List.hs b/Command/List.hs
index 663da4500..763908116 100644
--- a/Command/List.hs
+++ b/Command/List.hs
@@ -31,11 +31,11 @@ def = [noCommit $ withOptions [allrepos] $ command "list" paramPaths seek
allrepos :: Option
allrepos = Option.flag [] "allrepos" "show all repositories, not only remotes"
-seek :: [CommandSeek]
-seek =
- [ withValue getList $ withWords . startHeader
- , withValue getList $ withFilesInGit . whenAnnexed . start
- ]
+seek :: CommandSeek
+seek ps = do
+ list <- getList
+ printHeader list
+ withFilesInGit (whenAnnexed $ start list) ps
getList :: Annex [(UUID, RemoteName, TrustLevel)]
getList = ifM (Annex.getFlag $ Option.name allrepos)
@@ -58,10 +58,8 @@ getList = ifM (Annex.getFlag $ Option.name allrepos)
return $ sortBy (comparing snd3) $
filter (\t -> thd3 t /= DeadTrusted) rs3
-startHeader :: [(UUID, RemoteName, TrustLevel)] -> [String] -> CommandStart
-startHeader l _ = do
- liftIO $ putStrLn $ header $ map (\(_, n, t) -> (n, t)) l
- stop
+printHeader :: [(UUID, RemoteName, TrustLevel)] -> Annex ()
+printHeader l = liftIO $ putStrLn $ header $ map (\(_, n, t) -> (n, t)) l
start :: [(UUID, RemoteName, TrustLevel)] -> FilePath -> (Key, Backend) -> CommandStart
start l file (key, _) = do