content: New command line way to view and configure a repository's preferred content settings.

This commit is contained in:
Joey Hess 2013-05-25 12:44:58 -04:00
parent e3c1586997
commit b276857a7a
8 changed files with 70 additions and 8 deletions

View file

@ -117,8 +117,8 @@ genCfg cfg descs = unlines $ concat [intro, trust, groups, preferredcontent]
[ ""
, com "Repository preferred contents"
]
(\(s, u) -> line "preferred-content" u s)
(\u -> line "preferred-content" u "")
(\(s, u) -> line "content" u s)
(\u -> line "content" u "")
settings field desc showvals showdefaults = concat
[ desc
@ -167,7 +167,7 @@ parseCfg curcfg = go [] curcfg . lines
| setting == "group" =
let m = M.insert u (S.fromList $ words value) (cfgGroupMap cfg)
in Right $ cfg { cfgGroupMap = m }
| setting == "preferred-content" =
| setting == "content" =
case checkPreferredContentExpression value of
Just e -> Left e
Nothing ->