summaryrefslogtreecommitdiff
path: root/Command/MetaData.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-07-20 15:22:55 -0400
committerJoey Hess <joeyh@joeyh.name>2016-07-20 15:23:43 -0400
commitd13194b23048e3182650de42de6f1bcd3460045f (patch)
tree3f1c3a6e90b2e786c4368c66833f726d75429a39 /Command/MetaData.hs
parent847944e6b13515582d3d55cd0b394f008da2b3b7 (diff)
--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.
Diffstat (limited to 'Command/MetaData.hs')
-rw-r--r--Command/MetaData.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/Command/MetaData.hs b/Command/MetaData.hs
index e2afccb9b6..14e727fc78 100644
--- a/Command/MetaData.hs
+++ b/Command/MetaData.hs
@@ -69,20 +69,19 @@ seek o = do
(forFiles o)
start :: POSIXTime -> MetaDataOptions -> FilePath -> Key -> CommandStart
-start now o file = start' (Just file) now o
-
-startKeys :: POSIXTime -> MetaDataOptions -> Key -> CommandStart
-startKeys = start' Nothing
+start now o file k = startKeys now o k (mkActionItem afile)
+ where
+ afile = Just file
-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