Skip to content

Commit

Permalink
Refactor positional argument parsing to remove unnecessary flags
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Mahad <[email protected]>
  • Loading branch information
MahadMuhammad committed Jan 18, 2025
1 parent b8049cb commit ebd807b
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 @@ -59,14 +59,14 @@ mod tests {

#[test]
fn test_required_argument_file() {
let args = Arguments::parse_from(["test", "-f", "test.rs"]);
let args = Arguments::parse_from(["test", "test.rs"]);
assert_eq!(args.source_file, path::PathBuf::from("test.rs"));
assert_eq!(args.stderr_file, None);
}

#[test]
fn test_optional_argument_file() {
let args = Arguments::parse_from(["test", "-f", "test.rs", "-e", "test.stderr"]);
let args = Arguments::parse_from(["test", "test.rs", "-e", "test.stderr"]);
assert_eq!(args.source_file, path::PathBuf::from("test.rs"));
assert_eq!(args.stderr_file, Some(path::PathBuf::from("test.stderr")));
}
Expand Down

0 comments on commit ebd807b

Please sign in to comment.