From b4a3ee7f59a3f3783e24795a90a744052fe1029a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 22 Feb 2014 16:32:39 -0400 Subject: [PATCH] rather ugly workaround for directories with spaces as MetaFields --- Command/View.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Command/View.hs b/Command/View.hs index ea63d39fde..f123e38123 100644 --- a/Command/View.hs +++ b/Command/View.hs @@ -45,10 +45,17 @@ perform view = do paramView :: String paramView = paramPair (paramRepeating "TAG") (paramRepeating "FIELD=VALUE") +{- Parse field=value + - + - Note that the field may not be a legal metadata field name, + - but it's let through anywa (using MetaField rather than mkMetaField). + - This is useful when matching on directory names with spaces, + - which are not legal MetaFields. + -} parseViewParam :: String -> (MetaField, String) parseViewParam s = case separate (== '=') s of (tag, []) -> (tagMetaField, tag) - (field, wanted) -> either error (\f -> (f, wanted)) (mkMetaField field) + (field, wanted) -> (MetaField field, wanted) mkView :: [String] -> Annex View mkView params = do