rsm-hcd / AndcultureCode.CSharp.Cli

Common utiltiies when build CSharp CLIs at andculture

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AndcultureCode.CSharp.Cli

build status codecov All Contributors

Commonly used utilities when building CSharp CLIs for .NET Core C#

Getting Started

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
}

Documentation

Full API Documentation

Development Setup

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.

Building project

  • Run the build command
    and-cli dotnet --build
    

Running tests along with code coverage

  • Run the test command
    and-cli dotnet-test
    
  • Open the coverage/index.htm file in your browser

Publishing a new version

Contributing

Information on contributing to this repo is in the Contributing Guide

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Winton DeShong

💻 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

About

Common utiltiies when build CSharp CLIs at andculture

License:Apache License 2.0


Languages

Language:C# 100.0%