Skip to content

Commit

Permalink
enhance: allow shortform arguments too
Browse files Browse the repository at this point in the history
  • Loading branch information
carrascomj committed Jan 20, 2025
1 parent ac4fa82 commit 421261b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ pub fn parse_args() -> CliArgs {
let (map_path, data_path) = args.iter().skip(1).zip(args.iter().skip(2)).fold(
(None, None),
|(map, data), (arg, next)| match arg.as_str() {
"--map" => (Some(PathBuf::from(next)), data),
"--data" => (map, Some(PathBuf::from(next))),
"--map" | "-m" => (Some(PathBuf::from(next)), data),
"--data" | "-d" => (map, Some(PathBuf::from(next))),
_ => (map, data),
},
);
Expand Down

0 comments on commit 421261b

Please sign in to comment.