INNER CODE UNIT · Rust
new
atanunq/viu · src/config.rs:17
pub fn new(matches: &'a ArgMatches) -> Config<'a> {
let width = matches.get_one("width").cloned();
let height = matches.get_one("height").cloned();
let files: Vec<&str> = matches
.get_many::<String>("file")
.unwrap_or_default()
.map(|s| s.as_str())
.collect();
let absolute_offset = matches.get_flag("absolute-offset");
let x: u16 = matches
.get_one("x")
.cloned()
.expect("X offset must be present");
let y: i16 = matches
.get_one("y")
.cloned()