Commit graph

11 commits

Author SHA1 Message Date
Austin Clements
1c6195b9e3 cli: Framework for structured output versioning
Currently there is a period of pain whenever we make
backward-incompatible changes to the structured output format, which
discourages not only backward-incompatible improvements to the format,
but also backwards-compatible additions that may not be "perfect".  In
the end, these problems limit experimentation and innovation.

This series of patches introduces a way for CLI callers to request a
specific format version on the command line and to determine if the
CLI does not supported the requested version (and perhaps present a
useful diagnostic to the user).  Since the caller requests a format
version, it's also possible for the CLI to support multiple
incompatible versions simultaneously, unlike the alternate approach of
including version information in the output.

This patch lays the groundwork by introducing a versioning convention,
standard exit codes, and a utility function to check the requested
version and produce standardized diagnostic messages and exit
statuses.
2012-12-16 17:20:33 -04:00
Peter Feigl
102f58d7a4 Use the S-Expression structured printer in notmuch-show, notmuch-reply and notmuch-search.
This patch uses the new S-Expression printer in the notmuch CLI (show,
search and reply). You can now use --format=sexp for any of them.
2012-12-08 09:30:19 -04:00
Peter Feigl
1bf3720b6e Rename the -json printer functions in notmuch-reply and notmuch-show to generic -sprinter functions.
All the structured output functions in notmuch-reply and notmuch-show
are renamed to a generic name (as they do not contain any json-specific
code anyway). This patch is a preparation to actually using the new
S-Expression sprinter in notmuch-reply and notmuch-show.
2012-12-08 09:28:19 -04:00
Austin Clements
70dacc1fd9 devel: Add Reply-to to the schemata
The code got out of sync with the documentation in 7d3c06dc.
2012-11-08 09:49:22 -04:00
Mark Walters
ed93d79199 schemata: update for --body=true|false option
Previously body: was a compulsory field in a message. The new
--body=false option causes notmuch show to omit this field so update
schemata to reflect this.
2012-07-24 15:49:33 -03:00
Austin Clements
e7f5302114 Add missing "tags" field to search schema
This field is output by search, but it didn't make it into the
documentation.
2012-07-09 15:45:37 -06:00
Mark Walters
51a7cd3ddb Minor correction to devel/schemata
In id:"87sjdm12d1.fsf@awakening.csail.mit.edu" Austin pointed out that
devel/schemata needs a slight correction with the new
--entire-thread=false option. This is that correction.
2012-06-30 08:21:36 -03:00
Mark Walters
fdce20d365 Update devel/schemata for --entire-thread=false
Also remove the Json --entire-thread item from devel/TODO.
2012-06-29 22:33:13 -03:00
Austin Clements
98cad5a207 Sync schemata with current code structure
The schema itself hasn't changed, but many of the references to
functions in notmuch-show.c were out of date.
2012-04-15 09:42:14 -03:00
Adam Wolfe Gordon
5abc9c1097 schemata: Add documentation for JSON reply format. 2012-03-19 21:56:25 -03:00
Austin Clements
661c357123 Document the JSON schemata used by show and search 2012-02-27 22:32:49 -04:00