Open eaigner opened 3 years ago
Another common occurrence of this is running the executable via a symlink, where the symlink has a different basename to the executable it's pointing to.
I guess ProcessInfo.processInfo.processName
from Foundation already has the logic for slicing up argv[0]
?
The default
USAGE
output derives the usage command name from theParsableCommand
type name. Now this might be correct or not. The "correct" way would be to always use the last path component ofargv[0]
, as it would also show the correct string in case the build product name is different from the class name or the user renames the tool.While there is
_commandName
I can use to override this, it is marked as for internal use only.