Command-line arguments are a common way to parameterize execution of programs. For example, dotnet run -- arg1 arg2 uses arg1 and arg2 as arguments to the program.
To experiment with command-line arguments, it’s best to build the program first:
In F#, the argv parameter in the main function already excludes the program name, which is different from some other languages. If you need the program name, you can use Environment.GetCommandLineArgs().
Next, we’ll look at more advanced command-line processing with flags.