on master help sign in
Cleaned up terminal-width validation even more
commit7ef0fe091dcd266f8af262d896638fcd7231b0a9 authorEthan P <eth-p+git@hidden.email> dateFri 10 May 2019, 14:27 (8 years ago) parent89fcbb2
1 file changed+1−7
src/clap_app.rs+1−7
src/clap_app.rs+1−7
@@ -334,13 +334,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
334334 .validator(
335335 |t| {
336336 let is_offset = t.starts_with('+') || t.starts_with('-');
337− let num = if is_offset {
338− t.chars().skip(1).collect()
339− } else {
340− t
341− };
342−
343− num.parse::<u32>()
337+ t.parse::<i32>()
344338 .map_err(|_e| "must be an offset or number")
345339 .and_then(|v| if v == 0 && !is_offset {
346340 Err("terminal width cannot be zero".into())