The original [parser](https://github.com/dotnet/fsharp/blob/main/src/Compiler/Driver/CompilerOptions.fs#L259) was written long time ago, since then a bunch of libraries for arg parsing popped up, we can try switching to some. Some libs I know of: [Argu](https://github.com/fsprojects/Argu), [CommandLineParser](https://github.com/commandlineparser/commandline).