Skip to main content

apply_output_captures

Function apply_output_captures 

Source
pub fn apply_output_captures(
    provider: &Provider,
    raw_args: &[String],
) -> Result<(Vec<String>, Vec<CapturedOutput>), CliError>
Expand description

Apply a provider’s output-capture rules to a flat arg list, producing a rewritten arg list (with temp paths in place of caller paths) plus a list of captures the proxy must read back after the subprocess exits.

Rules applied in order:

  1. Named flags from cli_output_args: any matching --flag value pair has its value rewritten to a temp path. Both --flag value and --flag=value forms are supported.
  2. Positional captures from cli_output_positional: longest matching subcommand prefix (after stripping cli_default_args) wins; the configured positional index within the remaining args is rewritten.