Currently, target create has no --platform option. However, TargetList::CreateTargetInternal which is called under the hood will return an error when either no platform or more than one is found that matches the given binary.
This patch adds the platform option, but that doesn't solve either of these errors. If more than one platform matches, specifying the platform isn't going to fix that. The current code will look at the architecture instead. So I've updated the error message to ask the user to specify an architecture. If no architecture is found, specifying a new one via platform isn't going to change that either because we already try to find one that matches the given architecture.
While I was there I also did some general cleanup/refactoring and improve the test coverage.
This comment was confusing before, but it's more confusing now because platform_sp might be the user specified platform or it might be the one passed in with --platform.