update
This commit is contained in:
parent
e76f1e4419
commit
526b699845
2 changed files with 40 additions and 0 deletions
18
src/main.rs
18
src/main.rs
|
@ -149,6 +149,24 @@ fn main() {
|
|||
|
||||
let mut diff = serde_json::to_value(diff).unwrap();
|
||||
|
||||
if let Some(test_cases) = args.get_many::<String>("test") {
|
||||
// TODO : Multiple test arguments
|
||||
let test_cases: Vec<_> = test_cases.collect();
|
||||
|
||||
let path = test_cases.get(0).unwrap();
|
||||
let val = test_cases.get(1).unwrap();
|
||||
|
||||
diff.as_array_mut().unwrap().insert(0,
|
||||
serde_json::json!(
|
||||
{
|
||||
"op": "test",
|
||||
"path": path,
|
||||
"value": val
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if let Some(excludes) = args.get_many::<String>("exclude") {
|
||||
let excludes: Vec<String> = excludes.cloned().collect();
|
||||
diff = exclude_json_paths(&diff, &excludes);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue