Dotnet Core Neat Console Starter Save

Starter kit for neatly structured neat .NET Core Console / Command Line Apps

Project README

.NET Core Neat Console Starter

This is a starting point for creating neatly structured .NET Core console apps in C#, using the Microsoft.Extensions.CommandLineUtils package to parse the commands.

I created this working as a student with 4DVision, who create custom software for complex processes of companies and organizations.

Adding a command

GreetCommand is an example of a command, see Commands/GreetCommand.cs.

  1. Create a new class for your command, eg. Commands.ListCommand
  2. Register the command in the RootCommand like this:
app.Command("list", c => ListCommand.Configure(c, options));
  1. Profit!

Adding a global option

IsEnthousiastic is an example of a global option.

  1. Add the property to CommandLineOptions
  2. Add a call to app.Option or app.Argument in CommandLineOptions.Parse and store the result
  3. Store the property in options at the bottom of CommandLineOptions.Parse

Learn more

Open Source Agenda is not affiliated with "Dotnet Core Neat Console Starter" Project. README Source: iamarcel/dotnet-core-neat-console-starter
Open Issues
Last Commit
6 years ago

Open Source Agenda Badge

Open Source Agenda Rating