Skip to content

Commit

Permalink
Merge pull request #53 from louis030195/save-text-file-flag2
Browse files Browse the repository at this point in the history
forgot one file
  • Loading branch information
m13v authored Jul 20, 2024
2 parents 9d289e8 + 6499978 commit 3e9679b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions screenpipe-vision/src/bin/screenpipe-vision.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
use screenpipe_vision::{continuous_capture, ControlMessage};
use std::time::Duration;
use tokio::sync::mpsc::channel;
use clap::Parser;

#[derive(Parser)]
#[command(author, version, about, long_about = None)]
struct Cli {
/// Save text files
#[arg(long, default_value_t = false)]
save_text_files: bool,
}

#[tokio::main]
async fn main() {
let cli = Cli::parse();

let (control_tx, mut control_rx) = channel(512);
let (result_tx, mut result_rx) = channel(512);

let save_text_files = cli.save_text_files;

let capture_thread = tokio::spawn(async move {
continuous_capture(&mut control_rx, result_tx, Duration::from_secs(1)).await
continuous_capture(&mut control_rx, result_tx, Duration::from_secs(1), save_text_files).await
});

// Example: Process results for 10 seconds, then pause for 5 seconds, then stop
Expand All @@ -30,4 +43,4 @@ async fn main() {
}

capture_thread.await.unwrap();
}
}

0 comments on commit 3e9679b

Please sign in to comment.