(and --json-error-messages
?) to provide more formalized machine readable serialization.
(weak) motivation: https://github.com/datalad/datalad/issues/6431
Added --json and --json-error-messages. Note that this did change the --batch output in a way that could possibly break something that expected the old output to never change. I think it's acceptable to break that because there has never been a guarantee of unchanging output format except with --batch for most commands.
The particular batch output format is not specified for this, and it's rather ad-hoc. I think this is the only --batch that is treated all as a single action with "registerurl (stdin)" at start and only one "ok" at the end of all the batched input. That was inherited from the non-batch behavior. Implementing --batch --json would need a second, redundant implementation that treats each batch input as its own action. Only using that for --json would be weird, but using it for --batch generally would be a behavior change. Urk.
Aside from crashing if an invalid key is provided, or perhaps some other exceptional error, there are no real ways it could fail so --json-error-messages is unlikely to be useful. But adding --json always adds it anyway.
(unregisterurl has the same interface and mostly same implementation, and so same problems as registerurl.)