Commonly used utilities when building CSharp CLIs for .NET Core C#
This package is installed via NuGet
dotnet add [<PROJECT>] package AndcultureCode.CSharp.Cli
After installation, simply import the extensions namespace to gain access to all of the available utilities.
using System;
using System.Collection.Generic;
using AndcultureCode.CSharp.Cli;
public class MyCommand : Command
{
#region Protected Properties
protected override string _commandDescription => "Top level command for that does something helpful";
#endregion Protected Properties
#region Constructor
public MyCommand(
CommandLineApplication command,
IConfigurationRoot configurationRoot,
IServiceCollection serviceCollection
) : base(command, configurationRoot, serviceCollection)
{
}
#endregion Constructor
#region Protected Methods
protected override void RegisterSubCommands()
{
_command.Command("mySubCommand", cmd => new MySubCommand(cmd, _configurationRoot, _serviceCollection));
}
#endregion Protected Methods
}
- Install Dotnet Core 2.x
- Install the
and-cli
tooling found at AndcultureCode.Cli
Below are a few basics to get you started, but there are many more commands and options for managing this and other projects found in the and-cli
.
- Run the build command
and-cli dotnet --build
- Run the test command
and-cli dotnet-test
- Open the
coverage/index.htm
file in your browser
- Run the publish command with the next version number (See semver package versioning)
and-cli nuget --publish <version>
Information on contributing to this repo is in the Contributing Guide
Thanks goes to these wonderful people (emoji key):
Winton DeShong 💻 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!