Do not pass --platform option to subcommands if NULL

As it would result in an InvalidArgumentException: The "--platform" option
requires a value.