rekey: New plumbing level command, can be used to change the keys used for files en masse.

This commit is contained in:
Joey Hess 2012-02-16 16:36:35 -04:00
parent aeaaa0ff87
commit db6b4cdfcf
6 changed files with 87 additions and 17 deletions

View file

@ -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