amiga-sys 0.0.2

Rust FFI bindings for the Amiga (m68k) system libraries
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# replaces all occurances of from-string with to-string in the given file

import sys

if len(sys.argv) != 4:
    print(f"usage: {sys.argv[0]} from-string to-string filename")
    exit(1)

from_string = sys.argv[1].replace("\\n", "\n")
to_string = sys.argv[2].replace("\\n", "\n")

with open(sys.argv[3]) as f:
    new_text = f.read().replace(from_string, to_string)

with open(sys.argv[3], "w") as f:
    f.write(new_text)