I prefer the top level run
function.
I think it is important to look for opportunities to reduce the amount of ceremony required to do simple things. It improves the approachability of the language as a whole.
There is always an option to add the module name to the function to disambiguate where needed. The compiler produces a reasonable fix-it in this case, where the combination of ArgumentParser and Subprocess creates an error.
If this were a function in Foundation
, and therefore automatically imported into nearly every Swift file, I would feel differently. But - it's not. It'll only be there in files where you import the module.
In addition, this pitch is for a 0.1 version of the package. If we truly come to regret this decision (or any other of the API decisions here), we have an opportunity to correct it before we get to a 1.0.