saner format for metadata --json
metadata --json output format has changed, adding a inner json object named "fields" which contains only the fields and their values. This should be easier to parse than the old format, which mixed up metadata fields with other keys in the json object. Any consumers of the old format will need to be updated. This adds a dependency on unordered-containers for parsing MetaData from JSON, but it's a free dependency; aeson pulls in that library.
This commit is contained in:
parent
5c92b8e034
commit
8bc8469c38
6 changed files with 80 additions and 6 deletions
|
@ -71,6 +71,16 @@ When run without any -s or -t parameters, displays the current metadata.
|
|||
Enable JSON output. This is intended to be parsed by programs that use
|
||||
git-annex. Each line of output is a JSON object.
|
||||
|
||||
The format of the JSON objects changed in git-annex version 6.20160726.
|
||||
|
||||
Example of the new format:
|
||||
|
||||
{"command":"metadata","file":"foo","key":"...","fields":{"author":["bar"],...},"note":"...","success":true}
|
||||
|
||||
Example of the old format, which lacks the inner fields object:
|
||||
|
||||
{"command":"metadata","file":"foo","key":"...","author":["bar"],...,"note":"...","success":true}
|
||||
|
||||
* `--all`
|
||||
|
||||
Specify instead of a file to get/set metadata on all known keys.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue