Skip to main content

run_process_with_sink

Function run_process_with_sink 

Source
pub fn run_process_with_sink<I, T>(args: I, sink: &mut dyn UiSink) -> i32
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,
Expand description

Runs the default application instance with the provided sink.

This is shorthand for building App::new and calling App::run_process_with_sink.

ยงExamples

use osp_cli::app::{BufferedUiSink, run_process_with_sink};

let mut sink = BufferedUiSink::default();
let exit = run_process_with_sink(["osp", "--help"], &mut sink);

assert_eq!(exit, 0);
assert!(!sink.stdout.is_empty());
assert!(sink.stderr.is_empty());