Re:Command Line Interface Guidelines
by enriquto on Tuesday February 06, 2024 @04:28PM
(#39280898)
Even safer: your program does never perform any actual deed. It just prints commands that you can run afterwards, using an external program, ideally a shell. This has the advantage of allowing the user to edit all the actions one by one.
Instead of
myprog # see what would happen
myprog --commit # alright, do it
You do
myprog # see what would happen
myprog | sh # alright, do it
But if you want to change something:
myprog > x
vi x
cat x | sh
And if you just want to run everything in parallel:
Instead of
You do But if you want to change something: And if you just want to run everything in parallel: