Reputation: 863
I am talking about this CLI extension:
Microsoft.Extensions.CommandLineUtils.
The project created is a console application, but this CLI extension has been added to it, so that arguments can be accepted.
What I do not understand is that, console apps also take arguments, then how is it different from the CLI? The CLI can be automated? So can the console app.
Would you please help me understand?
My question is not a duplicate of Parse command line arguments/options in C#. He is asking for clarification on compatibility issues. I am not. I am asking to understand the purpose of a CLI when there is already a console app available.
Upvotes: 2
Views: 1013
Reputation: 5584
A CLI application IS a console application. A console application can choose to use the CLI extensions for easier argument parsing.
When you create a simple console application you can pass parameters and parse the "args" parameter in the Main method. You have to validate and map those parameters manually.
The CommandLineUtils extensions manage much of this for you. You can specify if arguments are required, if they can appear more than once and other validations.
So it's not either/or but an option to make command line parsing easier.
Upvotes: 3