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.