importfeed: Support -J (and work toward supporting --json)
authorJoey Hess <joeyh@joeyh.name>
Tue, 9 May 2023 19:49:05 +0000 (15:49 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 9 May 2023 20:13:56 +0000 (16:13 -0400)
commit04ee6c4c6b26613344d9cb4e3b217c8c54b0d828
tree7d2059eb067deeb3837522f2f8270dbb2860c411
parenta71c831949bba5193230cdce6464d231fc5e4064
importfeed: Support -J (and work toward supporting --json)

Both -J and --json needed importfeed to be refactored to use commandAction.

That was difficult, because of the interrelated nature of downloading feeds
and then downloading files from feeds, both of which needed to use
commandAction. And then checking for problems in feeds has to come after
these actions, which may be run as background jobs.

As for --json support, it's most of the way there, but still has some
warts, so I didn't enable jsonOptions yet. The warts include:

- An initial empty json record is displayed by getCache.
- Input is not populated, should be feed url
- feedProblem at end will not be captured by --json-error-messages
  (see FIXME)

Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
CHANGELOG
Command/AddUrl.hs
Command/ImportFeed.hs
doc/git-annex-importfeed.mdwn
doc/todo/importfeed_parallell.mdwn