Rumble.Commander 0.0.2

dotnet add package Rumble.Commander --version 0.0.2
                    
NuGet\Install-Package Rumble.Commander -Version 0.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rumble.Commander" Version="0.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rumble.Commander" Version="0.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Rumble.Commander" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rumble.Commander --version 0.0.2
                    
#r "nuget: Rumble.Commander, 0.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rumble.Commander@0.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rumble.Commander&version=0.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Rumble.Commander&version=0.0.2
                    
Install as a Cake Tool

commander

A simple and intuitive console library to control console applications via commander objects like CommonCommander and ObjectCommander.

This repository contains the Rumble.Commander class library and Rumble.Commander.Demo demo project. All the content in the repository is an original work created to simplify the control of console applications in the .NET ecosystem.

NuGet Package: Rumble.Commander

Description

The Rumble.Commander is a configurable console command control program. Designed as a command-based utility to provide an intuitive interface to control console applications, Rumble.Commander allows developers to define specific actions, aliases, confirmation prompts, and more. The library is quite simple so it can be improved in many ways.

The Rumble.Commander.Demo.Runnable is a console application demonstrating the usage of the Rumble.Commander library.

Usage

Rumble.Commander Library

using Rumble.Commander.Commanders;
using Rumble.Commander.Commands;
using Rumble.Commander.Demo.Runnable;

using var commonCommander = new ObjectCommander<DummyServer>(new DummyServer())
{
    Settings = new ()
    {
        // Default values can be overridden...
        InputPrompt = "Please, enter the command",

        // ...or left as they are (can be omitted).
        ConfirmationPrompt = default!,
        UnknownInputHint = default!,

        // Extra tweaks also have default values
        // but available for override even for specific command.
        UseAliases = true,
        MatchCase = true,
        AskForConfirmation = false
    },
    CustomCommands = new ()
    {
        new ()
        {
            Action = commandable => commandable.Initialize(),
            Settings = new ()
            {
                Name = "initialize",
                Aliases = new () { "init" },

                // Commander will NOT use the aliases of this specific command.
                UseAliases = false
            }
        },
        new ()
        {
            Action = commandable => commandable.Start(),
            Settings = new ()
            {
                Name = "start",
                Aliases = new () { "begin", "run" },

                // Commander WILL treat "Start", "rUn" etc. as valid command names.
                MatchCase = false
            }
        },
        new ()
        {
            Action = commandable => commandable.Stop(),
            Settings = new ()
            {
                Name = "stop",
                Aliases = new () { "terminate" },

                // Commander WILL ask for confirmation.
                // This overrides behaviour specified on Commander level.
                AskForConfirmation = true,
                ConfirmationPrompt = "This command will STOP the server. Are you sure?"
            }
        }
    },

    // System commands such as "help" or "quit" can be overridden.
    // All parameters are available for override EXCEPT Action and Name.
    SystemCommandsOverrides = new ()
    {
        [Command.System.Name.Quit] = new ()
        {
            Aliases = new () { "release", "exit", "qq" },
            ConfirmationPrompt = "You are about to QUIT the current commander. Do you confirm?"
        }
    }

// Commander has to be run after the configuration.
}.Run();

Rumble.Commander.Demo.Runnable Console Application

To understand how to utilize the Rumble.Commander library, theRumble.Commander.Demo demo project provides comprehensive examples for various use cases. Simply browse the demo project to get started.

History

The Commander project is developed with an emphasis on flexibility and robustness, aiming to provide developers with fine-grained control over console applications in a .NET environment.

Contributing

If you have any suggestions, ideas, or feedback to enhance the project, please feel free to create an issue. Your collaboration is welcomed to make this project more powerful and efficient.

Note

The code is 100% original.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.2 214 8/20/2023
0.0.1 181 8/20/2023