Skip to main content

parse_captures

Function parse_captures 

Source
pub fn parse_captures(stdout: &str, wanted: &[String]) -> Captures
Expand description

Read an action’s declared captures out of its stdout.

Two shapes are accepted, because both are what a real command already emits: stdout whose first non-whitespace character is { is parsed as a flat JSON object (cloudctl ... --json), and anything else is read as KEY=VALUE lines (echo PREVIEW_ID=pv_9). Only declared names are taken and JSON scalars are stringified. A name the command did not emit is not an error — a resource may legitimately publish a handle only on some runs — but it is always reported in missing.