Skip to content

Latest commit

 

History

History
85 lines (67 loc) · 1.8 KB

File metadata and controls

85 lines (67 loc) · 1.8 KB

SimpleLine

About

SimpleLine an open source library that targets to simplify command line interaction.
Allows you to define new commands without having to think about getting values, type conversion, calling a specific type, and a lot of other troubles. It s written in C# language.

Why?

SimpleLine library makes it easy to write command-line applications

  • Facilitates development
  • Fairly easy to use
  • Easy enough to embed
  • Does not affect the testability of the system

Installation

.NET CLI

> dotnet add package SimpleLine --version 0.2.1-beta

Package Manager

PM> NuGet\Install-Package SimpleLine -Version 0.2.1-beta

Package Reference

<PackageReference Include="SimpleLine" Version="0.2.1-beta" />

Required .NET SDK 6.0+

Usage

To use the library, you need to complete several steps

1. Define commands

using SimpleLineLibrary.Setup;

[CommandDefinitions]
public class Example
{
    [Command("example")]
    public void Foo(int x)
    {
        Console.WriteLine($"result: {x * 2}");
    }
}

2. Set run library

using SimpleLineLibrary;

internal class Program
{
    static void Main(string[] args)
    {
        var conf = Configuration.Default(typeof(Program).Assembly);

        SimpleLine.Run(args, conf);
    }
}

3. Invoke

C:\> dotnet program.dll example -x 10
result: 20

Feedback or Suggestion

Docs

You can find fully documentation about project docs link

License

GNU GPL-3.0