Respects users' choices on the output JSON

This commit is contained in:
KnugiHK
2025-05-05 16:09:53 +08:00
parent b8652fcb96
commit 5a9944d14b
2 changed files with 17 additions and 5 deletions
+10 -3
View File
@@ -269,7 +269,7 @@ def validate_args(parser: ArgumentParser, args) -> None:
# Basic validation checks
if args.android and args.ios and args.exported and args.import_json:
parser.error("You must define only one device type.")
if not args.android and not args.ios and not args.exported and not args.import_json:
if not args.android and not args.ios and not args.exported and not args.import_json and not args.incremental_merge:
parser.error("You must define the device type.")
if args.no_html and not args.json and not args.text_format:
parser.error("You must either specify a JSON output file, text file output directory or enable HTML output.")
@@ -748,7 +748,14 @@ def main():
args.wa = "ContactsV2.sqlite"
if args.incremental_merge:
incremental_merge(args.source_dir, args.target_dir, args.media)
incremental_merge(
args.source_dir,
args.target_dir,
args.media,
args.pretty_print_json,
args.avoid_encoding_json
)
print("Incremental merge completed successfully.")
else:
# Process contacts
process_contacts(args, data, contact_store)
@@ -766,4 +773,4 @@ def main():
if __name__ == "__main__":
main()
main()