{"record":{"id":"92b1e837f185c5e8","repo":"dotnet/runtime","slug":"unknown-option-s","errorCode":null,"errorMessage":"Unknown option %s\n","messagePattern":"Unknown option (.+?)\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/coreclr/hosts/corerun/corerun.cpp","lineNumber":857,"sourceCode":"        {\n            i++;\n            if (i >= argc)\n            {\n                pal::fprintf(stderr, W(\"Option %s: missing .env file path\\n\"), arg);\n                break;\n            }\n\n            std::ifstream dotenvFile{ pal::convert_to_utf8(argv[i]) };\n            config.dotenv_configuration = dotenv{ pal::string_t{ argv[i] }, dotenvFile};\n        }\n        else if ((pal::strcmp(option, W(\"?\")) == 0 || (pal::strcmp(option, W(\"h\")) == 0 || (pal::strcmp(option, W(\"help\")) == 0))))\n        {\n            display_usage();\n            break;\n        }\n        else\n        {\n            pal::fprintf(stderr, W(\"Unknown option %s\\n\"), arg);\n            break;\n        }\n    }\n\n    return false;\n}\n\n// Forward declaration for self testing method.\nstatic int self_test();\n\n//\n// Entry points\n//\n\nint MAIN(const int argc, const char_t* argv[])\n{\n    configuration config{};\n    if (!parse_args(argc, argv, config))","sourceCodeStart":839,"sourceCodeEnd":875,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/hosts/corerun/corerun.cpp#L839-L875","documentation":"Printed by parse_args() in the final else branch when an option token does not match any known option (c/clr-path, p/property, l/preload, d/debug, st, e/env, ?/h/help). Parsing breaks and returns false -> EXIT_FAILURE.","triggerScenarios":"User runs e.g. 'corerun --foo bar App.dll' or 'corerun -x App.dll' or 'corerun -clr App.dll' (typo of clr-path). Any unrecognized -X / --xxx falls here.","commonSituations":"Typo in an option name; using options from a different host (dotnet run args) that corerun doesn't support; stale docs.","solutions":["Run 'corerun --help' to see the supported options.","Fix the typo (e.g. -clr -> -c or --clr-path).","Remember corerun supports only -c/--clr-path, -p/--property, -l/--preload, -d/--debug, -e/--env, -st, -?/-h/--help."],"exampleFix":"# before\ncorerun --runtime-path /x App.dll\n# after\ncorerun --clr-path /x App.dll","handlingStrategy":"validation","validationCode":"# whitelist the only options corerun supports\nallowed='^(\\-c|\\-\\-clr-path|\\-p|\\-\\-property|\\-l|\\-\\-preload|\\-d|\\-\\-debug|\\-st|\\-e|\\-\\-env|\\-\\?|\\-h|\\-\\-help)$'\nfor a in \"$@\"; do\n  case \"$a\" in -*) echo \"$a\" | grep -Eq \"$allowed\" || echo \"unknown option: $a\" ;; esac\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run 'corerun --help' to see the supported options.","Do not confuse corerun options with dotnet/dotnet-exec options.","Add an option whitelist check in build scripts."],"tags":["coreclr","corerun","cli","argument-parsing","unknown-option"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}