Skip to main content

print_json_value_or_scalar

Function print_json_value_or_scalar 

Source
pub fn print_json_value_or_scalar(
    value: impl AsRef<str> + Display,
) -> Result<()>
Expand description

Prints command output that may already be JSON: parsed and envelope-wrapped in --json mode, plain text otherwise. If the output is not valid JSON, it is wrapped as a scalar string.