parse_output: Parse the output of a Condathis command

View source: R/parse_output.R

parse_outputR Documentation

Parse the output of a Condathis command

Description

This function processes the result of a run() call by parsing the specified output stream (stdout or stderr) into individual, trimmed lines.

Usage

parse_output(res, stream = c("stdout", "stderr"))

Arguments

res

A list containing the result of run(), typically including stdout and stderr as character strings.

stream

A character string specifying the data stream to parse. Must be either "stdout" or "stderr". Defaults to "stdout".

Value

A character vector where each element is a trimmed line from the specified stream.

Examples

# Example result object from condathis::run()
res <- list(
  stdout = "line1\nline2\nline3\n",
  stderr = "error1\nerror2\n"
)

# Parse the standard output
parse_output(res, stream = "stdout")

# Parse the standard error
parse_output(res, stream = "stderr")


condathis documentation built on April 12, 2025, 2:01 a.m.