summaryrefslogtreecommitdiff
path: root/Seek.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-02-16 16:36:35 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-02-16 16:36:35 -0400
commitdb6b4cdfcf67cfc3fce5e5f4323aa96a6ebd3e59 (patch)
treea65a129d7289b400e1b558e7b6d3c19eefd54f76 /Seek.hs
parentaeaaa0ff87e22c3a5b4c9657544224c9db006cde (diff)
rekey: New plumbing level command, can be used to change the keys used for files en masse.
Diffstat (limited to 'Seek.hs')
-rw-r--r--Seek.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Seek.hs b/Seek.hs
index 6f56f30f4..7a53fc04b 100644
--- a/Seek.hs
+++ b/Seek.hs
@@ -45,6 +45,13 @@ withWords a params = return [a params]
withStrings :: (String -> CommandStart) -> CommandSeek
withStrings a params = return $ map a params
+withPairs :: ((String, String) -> CommandStart) -> CommandSeek
+withPairs a params = return $ map a $ pairs [] params
+ where
+ pairs c [] = reverse c
+ pairs c (x:y:xs) = pairs ((x,y):c) xs
+ pairs _ _ = error "expected pairs"
+
withFilesToBeCommitted :: (String -> CommandStart) -> CommandSeek
withFilesToBeCommitted a params = prepFiltered a $
seekHelper LsFiles.stagedNotDeleted params