dotnet / dotnet-wasi-sdk

An SDK for building .NET projects as standalone WASI-compliant modules
MIT License
279 stars 12 forks source link

How can you receive command line args? #29

Open coty-terumo opened 9 months ago

coty-terumo commented 9 months ago
// Program.cs
Console.WriteLine();
string[] arguments = Environment.GetCommandLineArgs();
Console.WriteLine("GetCommandLineArgs: {0}", string.Join(", ", arguments));
dotnet run hello # dotnet run -- hello ; wasmtime <path> hello ; wasmtime <path> -- hello

# GetCommandLineArgs: 

# expected: GetCommandLineArgs: <path>, hello