From f296a5144b4793820b61ce6aa74a128b53fddc11 Mon Sep 17 00:00:00 2001 From: Cam Soper Date: Thu, 14 Mar 2024 11:13:52 -0500 Subject: [PATCH 1/2] Fresh date, add System.CommandLine --- .../fundamentals/program-structure/main-command-line.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/csharp/fundamentals/program-structure/main-command-line.md b/docs/csharp/fundamentals/program-structure/main-command-line.md index 06a7303fd8bef..16c9b9df7880c 100644 --- a/docs/csharp/fundamentals/program-structure/main-command-line.md +++ b/docs/csharp/fundamentals/program-structure/main-command-line.md @@ -1,7 +1,7 @@ --- title: "Main() and command-line arguments" description: Learn about Main() and command-line arguments. The 'Main' method is the entry point of an executable program. -ms.date: 05/14/2021 +ms.date: 03/14/2024 f1_keywords: - "main_CSharpKeyword" - "Main" @@ -189,6 +189,9 @@ long num = Convert.ToInt64(s); For more information, see and . +> [!TIP] +> Parsing command-line arguments can be complex. Consider using the [System.CommandLine](/dotnet/standard/commandline/) library (currently in beta) library to simplify the process. + The following example shows how to use command-line arguments in a console application. The application takes one argument at run time, converts the argument to an integer, and calculates the factorial of the number. If no arguments are supplied, the application issues a message that explains the correct usage of the program. To compile and run the application from a command prompt, follow these steps: From c7681dea2aa790259c9abfb9aeb8c67867eba033 Mon Sep 17 00:00:00 2001 From: Cam Soper Date: Thu, 14 Mar 2024 17:56:06 -0500 Subject: [PATCH 2/2] I don't want to send them to the library library --- docs/csharp/fundamentals/program-structure/main-command-line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/fundamentals/program-structure/main-command-line.md b/docs/csharp/fundamentals/program-structure/main-command-line.md index 16c9b9df7880c..ee051c5acc6a9 100644 --- a/docs/csharp/fundamentals/program-structure/main-command-line.md +++ b/docs/csharp/fundamentals/program-structure/main-command-line.md @@ -190,7 +190,7 @@ long num = Convert.ToInt64(s); For more information, see and . > [!TIP] -> Parsing command-line arguments can be complex. Consider using the [System.CommandLine](/dotnet/standard/commandline/) library (currently in beta) library to simplify the process. +> Parsing command-line arguments can be complex. Consider using the [System.CommandLine](/dotnet/standard/commandline/) library (currently in beta) to simplify the process. The following example shows how to use command-line arguments in a console application. The application takes one argument at run time, converts the argument to an integer, and calculates the factorial of the number. If no arguments are supplied, the application issues a message that explains the correct usage of the program.