script.py: improve edit command