0052 - Argument parsing in a console application howto tutorial

preview_player
Показать описание
Argument parsing in a console application howto tutorial
▸In this video tutorial we go over the topic of building a console application and specifically the argument parsing logic.

Arguments are a key part of many console applications and most of the time it takes longer to build the logic of how to properly parse the arguments that we want users to provide rather than the process of building the actual logic of the application.We show you how to use an existing open source class called NDesk Options to obtain some information from the user and leverage those inputs to trigger the different parts of our application.
In the end, we end up with a fully functional console application that is able to display the username, computer name, OS Version details, IP Address information, as well as any extra arguments that the user provided in the Debugging section of our application.

▬ SUBSCRIBE & LEARN ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

▬ RELATED VIDEOS ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

▬ MY EQUIPMENT ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

▬ SOCIAL MEDIA ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

▬ DISCLAMER ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This helps support the channel and allows me to continue to make videos like this. Thank you for the support!

#clouddeveloper #consoleapp #csharp #dotnetcore #development #programming #coding #devops
Рекомендации по теме
Комментарии
Автор

thanks! Super useful and well presented.

JoseOliveira-cncc
Автор

Have you run into an issue with NDesk where you can't get into an argument's lambda? Or it's not parsing that argument? I'm running into that now.

ryanjacksonx
Автор

Thank you in 2021
if you could provide a source code of this project it will be so cool!!

lowquality
Автор

Hi,

wondering if you could help me out. In a C# console application, using NDESK.Options, if the user selects a certain flag (for this example let's say "other") I need to ensure that 4 values are passed (which in turn will populate 4 variables).
Example:

app.exe -other «val1» «val2» «val3» «val4»

where val1 will be Username
where val2 will be Hostname
where val3 will be CurrIPAddr
where val4 will be OSVer

How to handle this using NDesk.Options? Any insight would be appreciated!

José

JoseOliveira-cncc
visit shbcf.ru