News for hackers. Stuff that matters.
Re:Command Line Interface Guidelines by int_19h on Tuesday February 06, 2024 @01:55PM (#39278770)
Here's a possibly more interesting take on this: instead of do-thing.py, imagine if there was thing.py, which processed all that complex CLI options, and as output produced a linear shell script, with each line invoking some atomic operation, and a comment explaining which options contributed to that particular line.
Re:Command Line Interface Guidelines by eichin on Tuesday February 06, 2024 @02:47PM (#39279542)
Yeah, that's a pattern I use for occasional sysadmin tools - the command itself generates the actual commands, I review them, then "<up arrow> | sh -xeu". (Yes, there's no guarantee that the output is the same, so I don't use the pattern when that's a risk; it's also rarely if ever used for things I expect other people to run, just bulk operations that are saving me repetition.)