Skip to content

Commit

Permalink
Fresh date, add System.CommandLine (#40004)
Browse files Browse the repository at this point in the history
  • Loading branch information
CamSoper committed Mar 15, 2024
1 parent ad50689 commit 535537a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -189,6 +189,9 @@ long num = Convert.ToInt64(s);

For more information, see <xref:System.Int64.Parse%2A> and <xref:System.Convert>.

> [!TIP]
> 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.

To compile and run the application from a command prompt, follow these steps:
Expand Down

0 comments on commit 535537a

Please sign in to comment.