Skip to content

A .NET/C# Library to Build your own custom Command Line Interfaces (CLI)

License

Notifications You must be signed in to change notification settings

hisleiterj/elch-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elch-cli

A .NET/C# Library to Build your own custom Command Line Interfaces (CLI) with convenient features like Tab-Complete and Command History.

Usage

static void Main(string[] args)
{
    Console.Title = "My CLI";
    new MyCli().Run();
}
internal class MyCli : CliBase
{
    private readonly ICommand[] _commands;
    public MyCli()
    {
        _commands = new[]
        {
            HelpCommand,
            new MultiplyCmd(),
            new DummyGitCmd(),
            new LongRunningCommand(),
            new Command("echo", args => { System.Console.WriteLine($"You said: '{args[0]}'"); }),
            ExitCommand
        };
    }
    protected override void OnAfterInitialization()
    {
        Colorful.Console.WriteAscii("DEMO CLI", ColorScheme.Color2);
        System.Console.WriteLine("This is Demo CLI V1.0");
        System.Console.WriteLine("Enter 'help' for information about available commands.");
        System.Console.WriteLine();
    }
    protected override IEnumerable<ICommand> GetCommands() => _commands;
}

About

A .NET/C# Library to Build your own custom Command Line Interfaces (CLI)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages