cmd/replace.py
Ethan Dalool 4a9051e617
Big migrations and linting.
With pathclass.glob_many, we can clean up and feel more confident
about many programs that use pipeable to take glob patterns.

Added return 0 to all programs that didn't have it, so we have
consistent and explicit command line return values.

Other linting and whitespace.
2021-09-23 23:42:45 -07:00

10 lines
214 B
Python

import sys
from voussoirkit import pipeable
lines = pipeable.input(sys.argv[1])
replace_from = sys.argv[2]
replace_to = sys.argv[3]
for line in lines:
pipeable.stdout(line.replace(replace_from, replace_to))