aboutsummaryrefslogtreecommitdiff
path: root/Command/View.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-02-22 16:32:39 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-02-22 16:32:39 -0400
commita4746a14ce077b18f962b91f415335b0042120bd (patch)
treeb54f4a06d25e467fd250e9e4f35899e8bd22597b /Command/View.hs
parent5463fc4d8df52be0c0232f1c44956b2227ad193c (diff)
rather ugly workaround for directories with spaces as MetaFields
Diffstat (limited to 'Command/View.hs')
-rw-r--r--Command/View.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Command/View.hs b/Command/View.hs
index ea63d39fd..f123e3812 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