Skip to content

Commit

Permalink
Revert "russelltg#43: fix negative positions"
Browse files Browse the repository at this point in the history
This reverts commit eabd6dd.
  • Loading branch information
ThatOneCalculator committed Jan 12, 2024
1 parent c576cc5 commit 4d1da88
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ pub struct Args {
)]
filename: String,

#[clap(long, short, value_parser=parse_geometry, help="geometry to capture, format x,y WxH. Compatible with the output of `slurp`. Mutually exclusive with --output", allow_hyphen_values=true)]
geometry: Option<(i32, i32, u32, u32)>,
#[clap(long, short, value_parser=parse_geometry, help="geometry to capture, format x,y WxH. Compatiable with the output of `slurp`. Mutually exclusive with --output")]
geometry: Option<(u32, u32, u32, u32)>,

#[clap(
long,
Expand Down Expand Up @@ -216,7 +216,7 @@ enum ParseGeometryError {
Size,
}

fn parse_geometry(s: &str) -> Result<(i32, i32, u32, u32), ParseGeometryError> {
fn parse_geometry(s: &str) -> Result<(u32, u32, u32, u32), ParseGeometryError> {
use ParseGeometryError::*;
let mut it = s.split(' ');
let loc = it.next().ok_or(Structure)?;
Expand Down Expand Up @@ -1024,6 +1024,8 @@ impl State {
}
}
(Some((x, y, w, h)), "") => {
let x = x as i32;
let y = y as i32;
let w = w as i32;
let h = h as i32;
// --geometry but no --output
Expand Down

0 comments on commit 4d1da88

Please sign in to comment.