initial implementation of --explain
Currently it only displays explanations of options like --in and --copies. In the future, it should explain preferred content expression evaluation and other decisions. The explanations of a few things could be better. In particular, "standard" will just appear as-is (or as "!standard" if it doesn't match), rather than explaining why the standard preferred content expression for the group matches or not. Currently as implemented, it goes to stdout, and so commands like git-annex find that have custom output will not display --explain information. Perhaps that should change, dunno. Sponsored-by: Dartmouth College's DANDI project
This commit is contained in:
parent
cf40e2d4b6
commit
f25eeedeac
12 changed files with 122 additions and 46 deletions
|
@ -1,6 +1,6 @@
|
|||
{- git-annex file matcher types
|
||||
-
|
||||
- Copyright 2013-2021 Joey Hess <id@joeyh.name>
|
||||
- Copyright 2013-2023 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
@ -11,7 +11,7 @@ import Types.UUID (UUID)
|
|||
import Types.Key (Key)
|
||||
import Types.Link (LinkType)
|
||||
import Types.Mime
|
||||
import Utility.Matcher (Matcher, Token)
|
||||
import Utility.Matcher (Matcher, Token, MatchDesc)
|
||||
import Utility.FileSize
|
||||
import Utility.FileSystemEncoding
|
||||
|
||||
|
@ -93,6 +93,8 @@ data MatchFiles a = MatchFiles
|
|||
-- ^ does the matchAction look at information about the key?
|
||||
, matchNeedsLocationLog :: Bool
|
||||
-- ^ does the matchAction look at the location log?
|
||||
, matchDesc :: Bool -> MatchDesc
|
||||
-- ^ displayed to the user to describe whether it matched or not
|
||||
}
|
||||
|
||||
type FileMatcher a = Matcher (MatchFiles a)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue