diff options
author | Joey Hess <joeyh@joeyh.name> | 2023-07-26 14:34:21 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2023-07-26 14:50:04 -0400 |
commit | 518a51a8a07f92b4f77992475f7daea1c1d7b51f (patch) | |
tree | 44ea06cc8aff32a95a7db3fe548d2277730321c5 /Types/FileMatcher.hs | |
parent | ba1c222912ede479cda8de171b92caf509aecd71 (diff) |
--explain for preferred/required content matching
And annex.largefiles and annex.addunlocked.
Also git-annex matchexpression --explain explains why its input
expression matches or fails to match.
When there is no limit, avoid explaining why the lack of limit
matches. This is also done when no preferred content expression is set,
although in a few cases it defaults to a non-empty matcher, which will
be explained.
Sponsored-by: Dartmouth College's DANDI project
Diffstat (limited to 'Types/FileMatcher.hs')
-rw-r--r-- | Types/FileMatcher.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Types/FileMatcher.hs b/Types/FileMatcher.hs index b6e06f76d3..e76192488c 100644 --- a/Types/FileMatcher.hs +++ b/Types/FileMatcher.hs @@ -76,6 +76,8 @@ getUserInfo :: MonadIO m => UserInfo a -> m a getUserInfo (Right i) = return i getUserInfo (Left e) = liftIO e +newtype MatcherDesc = MatcherDesc String + type FileMatcherMap a = M.Map UUID (FileMatcher a) type MkLimit a = String -> Either String (MatchFiles a) @@ -97,7 +99,7 @@ data MatchFiles a = MatchFiles -- ^ displayed to the user to describe whether it matched or not } -type FileMatcher a = Matcher (MatchFiles a) +type FileMatcher a = (Matcher (MatchFiles a), MatcherDesc) -- This is a matcher that can have tokens added to it while it's being -- built, and once complete is compiled to an unchangeable matcher. |