From a0628f5c2968d6bb904c52f9a06a16c679f92e70 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 9 May 2023 15:05:13 +0200 Subject: Document JSON dump format (GH issue #182) --- libbuild2/b-options.cxx | 8 ++++---- libbuild2/b.cli | 10 +++++----- libbuild2/dump.cxx | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'libbuild2') diff --git a/libbuild2/b-options.cxx b/libbuild2/b-options.cxx index 251c709..8258dea 100644 --- a/libbuild2/b-options.cxx +++ b/libbuild2/b-options.cxx @@ -1020,10 +1020,10 @@ namespace build2 << " to \033[1mstdout\033[0m). For details on the \033[1mbuildfile\033[0m format, see" << ::std::endl << " Diagnostics and Debugging (b#intro-diag-debug). For" << ::std::endl << " details on the \033[1mjson-v0.1\033[0m format, see the JSON OUTPUT" << ::std::endl - << " section below (overall properties) and Build System" << ::std::endl - << " State JSON Dump Format (b#@@) (format specifics). Note" << ::std::endl - << " that the JSON format is currently unstable (thus the" << ::std::endl - << " temporary \033[1m-v0.1\033[0m suffix)." << ::std::endl + << " section below (overall properties) and JSON Dump Format" << ::std::endl + << " (b#json-dump) (format specifics). Note that the JSON" << ::std::endl + << " format is currently unstable (thus the temporary \033[1m-v0.1\033[0m" << ::std::endl + << " suffix)." << ::std::endl << ::std::endl << " Note that because it's possible to end up with multiple" << ::std::endl << " dumps (for example, by specifying the \033[1m--dump-scope\033[0m" << ::std::endl diff --git a/libbuild2/b.cli b/libbuild2/b.cli index c9dfddd..1c994df 100644 --- a/libbuild2/b.cli +++ b/libbuild2/b.cli @@ -798,7 +798,7 @@ namespace build2 string --dump-format { - // NOTE: fix all references to json-v0.1 + // NOTE: fix all references to json-v0.1, including the manual. // "", "Representation format and output stream to use when dumping the build @@ -808,9 +808,9 @@ namespace build2 written to \cb{stdout}). For details on the \cb{buildfile} format, see \l{b#intro-diag-debug Diagnostics and Debugging}. For details on the \cb{json-v0.1} format, see the JSON OUTPUT section below (overall - properties) and \l{b#@@ Build System State JSON Dump Format} (format - specifics). Note that the JSON format is currently unstable (thus - the temporary \cb{-v0.1} suffix). + properties) and \l{b#json-dump JSON Dump Format} (format specifics). + Note that the JSON format is currently unstable (thus the temporary + \cb{-v0.1} suffix). Note that because it's possible to end up with multiple dumps (for example, by specifying the \cb{--dump-scope} and/or \cb{--dump-target} @@ -981,7 +981,7 @@ namespace build2 The order in which default options files are loaded is traced at the verbosity level 3 (\cb{-V} option) or higher. - \h|JSON OUTPUT| + \h#json-output|JSON OUTPUT| Commands that support the JSON output specify their formats as a serialized representation of a C++ \cb{struct} or an array thereof. For diff --git a/libbuild2/dump.cxx b/libbuild2/dump.cxx index ca7254a..9b7f5b1 100644 --- a/libbuild2/dump.cxx +++ b/libbuild2/dump.cxx @@ -943,7 +943,7 @@ namespace build2 { string name; // Quoted/qualified name. string display_name; - string type; + string type; // Target type. //string declaration; optional group; // Quoted/qualified group target name. @@ -980,7 +980,7 @@ namespace build2 //string declaration; optional group; - optional path; // Absent of not path-based target, not assigned. + optional path; // Absent if not path-based target, not assigned. vector variables; @@ -1371,9 +1371,9 @@ namespace build2 #if 0 struct scope { - // The out_path member is relative to parent scopes. It is empty for the - // special global scope. The src_path member is absent if the same as - // out_path (in-source build or scope outside of project). + // The out_path member is relative to the parent scope. It is empty for + // the special global scope. The src_path member is absent if the same + // as out_path (in-source build or scope outside of project). // string out_path; optional src_path; -- cgit v1.1