3 ms·
Neat, but a little scary because you rely on it to interpret your intentions correctly. Usually when I am trying to do something, I build up my command in multi
by seiferteric 8y ago
Neat, but a little scary because you rely on it to interpret your intentions correctly. Usually when I am trying to do something, I build up my command in multiple steps, printing outputs and verifying it is correct before actually running the command. Maybe you could have a "diff" or "dryrun" mode that would show the potential changes. Another idea would be for this script to "compile" a CLI command using grep/awk/sed etc instead of doing the actual editing itself.
- bihla 8y agoThe interpretation is only translating into standard Perl one-liners, and by default the execution writes to stdout instead of modifying the file. I haven't written code to actually do the text transformations. My normal workflow is to write commands, pipe them together as needed, and when I think I am satisfied I'll store to a temporary file. If I really need to be extra sure then I will use my preferred ddiff tool to compare against the original before doing the swap. I may have mis-interpreted but I hope between this and the unit tests your concerns are alleviated
- seiferteric 8y agoOkay I misunderstood, thanks!