An open API service indexing awesome lists of open source software.

https://github.com/rsm-hcd/andculturecode.csharp.cli

Common utiltiies when build CSharp CLIs at andculture
https://github.com/rsm-hcd/andculturecode.csharp.cli

cli csharp dotnet-core hacktoberfest

Last synced: 6 months ago
JSON representation

Common utiltiies when build CSharp CLIs at andculture

Awesome Lists containing this project

README

        

# AndcultureCode.CSharp.Cli
![build status](https://github.com/AndcultureCode/AndcultureCode.CSharp.Cli/actions/workflows/build.yaml/badge.svg)
[![codecov](https://codecov.io/gh/AndcultureCode/AndcultureCode.CSharp.Cli/branch/main/graph/badge.svg)](https://codecov.io/gh/AndcultureCode/AndcultureCode.CSharp.Cli)
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)

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

## Getting Started
This package is installed via NuGet
```
dotnet add [] package AndcultureCode.CSharp.Cli
```

After installation, simply import the extensions namespace to gain access
to all of the available utilities.
```csharp
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](src/AndcultureCode.CSharp.Cli/AndcultureCode.CSharp.Cli.md)

## Development Setup

* Install Dotnet Core 2.x
* Install the `and-cli` tooling found at [AndcultureCode.Cli](https://github.com/AndcultureCode/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`.

### 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
* Run the publish command with the next version number ([See semver package versioning](https://docs.microsoft.com/en-us/nuget/concepts/package-versioning))
```
and-cli nuget --publish
```

Contributing
======

Information on contributing to this repo is in the [Contributing Guide](CONTRIBUTING.md)

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):



Winton DeShong

💻 📖

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!