mindflow 0.1.2

A command line client for Mindflow
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use clipboard::{ClipboardContext, ClipboardProvider};

pub fn handle_response_text(text: String, skip_clipboard: bool) {
    if !skip_clipboard {
        let mut ctx: ClipboardContext = ClipboardProvider::new().unwrap_or_else(|e| {
            panic!("Failed to create clipboard context: {}", e);
        });
        ctx.set_contents(text).unwrap_or_else(|e| {
            panic!("Failed to copy to clipboard: {}", e);
        });
        println!("Response copied to clipboard!!!");
        return
    }
    println!("{}", text);
}