Function task_hookrs::tw::save_to_cmd

source ·
pub fn save_to_cmd(tasks: Vec<&Task>, cmd: Command) -> Result<Child, Error>
Expand description

This function runs the given Command, pipes the tasks as JSON to it and returns a handle to the child process.

Examples found in repository?
src/tw.rs (line 74)
68
69
70
71
72
73
74
75
pub fn save_async<'a, T>(tasks: T) -> Result<Child, Error>
where
    T: IntoIterator<Item = &'a Task>,
{
    let mut cmd = Command::new("task");
    cmd.arg("import").stdin(Stdio::piped());
    save_to_cmd(tasks.into_iter().collect(), cmd)
}