checkKey a (MatchingInfo p) = maybe (return False) a (providedKey p)
checkKey a (MatchingUserInfo p) = a =<< getUserInfo (userProvidedKey p)
-matchDescSimple :: String -> Bool -> Utility.Matcher.MatchDesc
-matchDescSimple s b = Utility.Matcher.MatchDesc $ (if b then "" else "!") ++ s
+matchDescSimple :: String -> (Bool -> Utility.Matcher.MatchDesc)
+matchDescSimple s b = Utility.Matcher.MatchDesc $ s ++
+ if b then "[TRUE]" else "[FALSE]"
(=?) :: String -> String -> (Bool -> Utility.Matcher.MatchDesc)
-k =? v = \b -> Utility.Matcher.MatchDesc $ k ++ (if b then "==" else "!=") ++ v
+k =? v = matchDescSimple (k ++ "=" ++ v)
when (Annex.explainenabled rd) $
let d = actionItemDesc ai
in outputMessage JSON.none id $
- "[" <> (if d == mempty then "" else (d <> " ")) <> msg <> "]\n"
+ "[ " <> (if d == mempty then "" else (d <> " ")) <> msg <> " ]\n"
explain _ _ = return ()
{- Prevents any concurrent console access while running an action, so
what to do. The explanations will be inside square brackets.
For example, "[foo is not present here]"
+ This includes explanations of why preferred content expressions and
+ other similar expressions like annex.largefiles match or fail to match.
+ In these explanations, the expression is displayed, with each term
+ followed by "[TRUE]" or "[FALSE]" to indicate the value.
+ Irrelevant terms will be ommitted from the explanation, for example
+ `"exclude=* and copies=1"` will be displayed as `"exclude=*[FALSE]"`
+
* `--debug`
Display debug messages to standard error.
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 2"""
+ date="2023-07-26T19:31:40Z"
+ content="""
+--explain is implemented and expanations for preferred content expressions,
+annex.largefiles, and annex.addunlocked are now displayed.
+
+Leaving this open because I do think that explanations of numcopies and
+content presence checking should be added, as well as perhaps explanations
+of drop proofs.
+"""]]