init: Support --json and --json-error-messages
authorJoey Hess <joeyh@joeyh.name>
Mon, 8 May 2023 18:58:08 +0000 (14:58 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 8 May 2023 18:58:08 +0000 (14:58 -0400)
commitf09a248fe2e7e66670b9e90d5789802c1f9cb9d9
treea4f8f636fe9197a93a87f4bf02dfbf86e1471800
parentc20844229264950a6d87cc6baf3f82041d33bfe7
init: Support --json and --json-error-messages

Dunno how useful this will be, since about all that's accessible from
the json is whether it succeeded or failed, and the error messages
which were already on stderr.

Note that, when autoenabling a special remote, it would be possible for
one to stop and prompt or output not using Messages and so not output as
part of the json. I don't think that happens, but I'm not 100% sure
something doesn't manage to break it. Of course, the same could be the
case for commands that transfer objects. Using Annex.Init.autoEnableSpecialRemotes
in --json mode would avoid the problem, but I've chosen to wait until I
know it's needed to use it.

Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
CHANGELOG
Command/Init.hs
doc/git-annex-init.mdwn
doc/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn