--branch, stage 2

Show branch:file that is being operated on.

I had to make ActionItem a type and not a type class because
withKeyOptions' passed two different types of values when using the type
class, and I could not get the type checker to accept that.
This commit is contained in:
Joey Hess 2016-07-20 15:22:55 -04:00
parent 847944e6b1
commit d13194b230
Failed to extract signature
15 changed files with 145 additions and 102 deletions

View file

@ -69,20 +69,19 @@ seek o = do
(forFiles o)
start :: POSIXTime -> MetaDataOptions -> FilePath -> Key -> CommandStart
start now o file = start' (Just file) now o
start now o file k = startKeys now o k (mkActionItem afile)
where
afile = Just file
startKeys :: POSIXTime -> MetaDataOptions -> Key -> CommandStart
startKeys = start' Nothing
start' :: AssociatedFile -> POSIXTime -> MetaDataOptions -> Key -> CommandStart
start' afile now o k = case getSet o of
startKeys :: POSIXTime -> MetaDataOptions -> Key -> ActionItem -> CommandStart
startKeys now o k ai = case getSet o of
Get f -> do
l <- S.toList . currentMetaDataValues f <$> getCurrentMetaData k
liftIO $ forM_ l $
putStrLn . fromMetaValue
stop
_ -> do
showStart' "metadata" k afile
showStart' "metadata" k ai
next $ perform now o k
perform :: POSIXTime -> MetaDataOptions -> Key -> CommandPerform