Add tests defining `version` command's handling of unexpected flags or positional arguments (#38799)