Skip to content

Commit 34fc135

Browse files
committed
adding comments for future-me to understand flow in generate manual to match generate reference
1 parent b58be37 commit 34fc135

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Tools/generate-manual/GenerateManual.swift

+5
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ struct GenerateManual: ParsableCommand {
9292

9393
func run() throws {
9494
let data: Data
95+
// runs the tool with the --experimental-dump-help argument to capture
96+
// the output.
9597
do {
9698
let tool = URL(fileURLWithPath: tool)
9799
let output = try executeCommand(
@@ -101,9 +103,12 @@ struct GenerateManual: ParsableCommand {
101103
throw GenerateManualError.failedToRunSubprocess(error: error)
102104
}
103105

106+
// ToolInfoHeader is intentionally kept internal to argument parser to
107+
// allow the library some flexibility to update/change its content/format.
104108
do {
105109
let toolInfoThin = try JSONDecoder().decode(
106110
ToolInfoHeader.self, from: data)
111+
// verify the serialization version is known/expected
107112
guard toolInfoThin.serializationVersion == 0 else {
108113
throw GenerateManualError.unsupportedDumpHelpVersion(
109114
expected: 0,

0 commit comments

Comments
 (0)