add "input" field to json output

The use case of this field is mostly to support -J combined with --json.
When that is implemented, a user will be able to look at the field to
determine which of the requests they have sent it corresponds to.

The field typically has a single value in its list, but in some cases
mutliple values (eg 2 command-line params) are combined together and the
list will have more.

Note that json parsing was already non-strict, so old git-annex metadata
--json --batch can be fed json produced by the new git-annex and will
not stumble over the new field.
This commit is contained in:
Joey Hess 2020-09-15 16:22:44 -04:00
parent 2a3c2b1843
commit fcf5d11c63
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
11 changed files with 66 additions and 60 deletions

View file

@ -78,7 +78,7 @@ seek o = do
getFeed :: AddUnlockedMatcher -> ImportFeedOptions -> Cache -> URLString -> CommandSeek
getFeed addunlockedmatcher opts cache url = do
showStart' "importfeed" (Just url)
showStartOther "importfeed" (Just url) (SeekInput [])
downloadFeed url >>= \case
Nothing -> showEndResult =<< feedProblem url
"downloading the feed failed"
@ -124,7 +124,7 @@ getCache :: Maybe String -> Annex Cache
getCache opttemplate = ifM (Annex.getState Annex.force)
( ret S.empty S.empty
, do
showStart "importfeed" "checking known urls"
showStart "importfeed" "checking known urls" (SeekInput [])
(is, us) <- unzip <$> knownItems
showEndOk
ret (S.fromList us) (S.fromList (concat is))
@ -256,7 +256,7 @@ performDownload addunlockedmatcher opts cache todownload = case location todownl
case dest of
Nothing -> return True
Just f -> do
showStart' "addurl" (Just url)
showStartOther "addurl" (Just url) (SeekInput [])
ks <- getter f
if null ks
then do