smart-patcher 0.7.0

Patcher based on rules
Documentation
#!/usr/bin/env python

# this is test patch for `src/patch.rs` tests

import json
import sys


if __name__ == "__main__":
  input_file = sys.argv[1]
  output_file = sys.argv[2]

  print(f"Files: '{input_file}', '{output_file}'")

  try:
    with open(input_file, 'r', encoding='utf-8') as f:
      input_data = json.load(f)

    start_pos = input_data["start_pos"]
    end_pos = input_data["end_pos"]

    with open(output_file, 'w', encoding='utf-8') as f:
      json.dump({"start_pos": start_pos, "end_pos": end_pos, "cursor_at_end": True}, f, ensure_ascii=False, indent=4)
  except Exception as e:
    print(f"Error: {str(e)}")
    sys.exit(1)