Skip to content

Commit

Permalink
Merge pull request #9 from griccardos/main
Browse files Browse the repository at this point in the history
add optional time delay
  • Loading branch information
kakoc authored Nov 22, 2024
2 parents 210fdfb + 1886237 commit ed8960e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ struct BirdyArgs {
/// save to clipboard instead of path
#[arg(short, long)]
clipboard: bool,
/// time to wait in seconds before screenshot
#[arg(short, long)]
time: Option<u64>,
}

#[derive(Serialize, Deserialize, Debug)]
Expand All @@ -144,8 +147,13 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
screen,
dir,
clipboard,
time: after,
} = BirdyArgs::parse();

if let Some(secs) = after {
std::thread::sleep(Duration::from_secs(secs));
}

let clipboard = match (clipboard, &dir) {
(true, Some(_)) => {
println!("Provided save dir not used when saving to clipboard.");
Expand Down

0 comments on commit ed8960e

Please sign in to comment.