Last active
April 13, 2024 12:22
-
-
Save mhrstmnn/3befa3fbcb8d2aec0cfabd0a1173a9e9 to your computer and use it in GitHub Desktop.
Simple method to output CLI arguments in C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
private static void PrintArgs(string[] args) | |
{ | |
Console.WriteLine("argc: " + args.Length); | |
if (args.Length > 0) | |
{ | |
Console.WriteLine("\nargs:"); | |
Console.WriteLine("- " + string.Join("\n- ", args)); | |
} | |
} | |
public static int Main(string[] args) | |
{ | |
Program.PrintArgs(args); | |
return 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment