smartcat 1.7.2

Putting a brain behind `cat`. CLI interface to bring language models in the Unix ecosystem 🐈‍⬛
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::process::{Child, Command};

pub(super) fn start_recording(recording_command: String) -> Option<Child> {
    // default commands for each os are defined in src/config/voice.rs
    Command::new(recording_command.split_whitespace().next().unwrap())
        .args(recording_command.split_whitespace().skip(1))
        .spawn()
        .ok()
}

pub(super) fn stop_recording(process: &mut Child) {
    process.kill().expect("Failed to stop recording.");
}