Skip to content

Commit

Permalink
[fix] make arguments to slurp optional
Browse files Browse the repository at this point in the history
  • Loading branch information
CheerfulPianissimo committed May 23, 2024
1 parent 094e398 commit 8f69d0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion wayshot/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct Cli {

/// Arguments to call slurp with for selecting a region
#[arg(short, long, value_name = "SLURP_ARGS")]
pub slurp: Option<String>,
pub slurp: Option<Option<String>>,

/// Enable cursor in screenshots
#[arg(short, long)]
Expand Down
4 changes: 2 additions & 2 deletions wayshot/src/wayshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ fn main() -> Result<()> {
return Ok(());
}

let image_buffer = if let Some(slurp_region) = cli.slurp {
let slurp_region = slurp_region.clone();
let image_buffer = if let Some(slurp_args) = cli.slurp {
let slurp_region = slurp_args.unwrap_or("".to_string());
wayshot_conn.screenshot_freeze(
Box::new(move || {
|| -> Result<LogicalRegion> {
Expand Down

0 comments on commit 8f69d0d

Please sign in to comment.