Skip to content

Commit dc62c46

Browse files
authored
Merge pull request #7 from kovrex-coder/feat/args-constructor
feat: add Args::new() constructor for library/API use
2 parents 5092589 + 646e359 commit dc62c46

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/cli/args.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,27 @@ impl Args {
5858
pub fn parse() -> Result<Self, clap::Error> {
5959
Self::try_parse()
6060
}
61+
62+
/// Create Args directly (for API/library use).
63+
pub fn new(
64+
old: PathBuf,
65+
new: PathBuf,
66+
key: Option<String>,
67+
threshold: f64,
68+
tolerance: f64,
69+
delimiter: Option<u8>,
70+
json: bool,
71+
) -> Self {
72+
Self {
73+
old,
74+
new,
75+
key,
76+
threshold,
77+
tolerance,
78+
delimiter,
79+
json,
80+
}
81+
}
6182
}
6283

6384
fn parse_threshold(raw: &str) -> Result<f64, String> {

0 commit comments

Comments
 (0)