That is entirely due to sh/bash and friends being a terrible programming language.
All sensible ones allow you to just pass an array of parameters to command execution and not worry about spaces in them
All sensible ones allow you to just pass an array of parameters to command execution and not worry about spaces in them
It's an array of string parameters.
No semantics! Just an variety of customs about what it means when a parameters begins with a - or a -- or if you have -- by itself preceding some characters, how to break lists of arguments with separators, what happens when you pass the same argument twice, etc etc etc.
To choose the worst possible solution better than that, we could instead be passing in a single string with a JSON dictionary that says things like '{ "recursive": True, "force": True, "files": [ "file1", "file2", "file3" ]}'
run(f”command {arg} -v -p{opt} {target}”)
to run([“command”, arg, “-v”, “-p”, opt, target])