CommandCenter 1.0.0

dotnet add package CommandCenter --version 1.0.0
NuGet\Install-Package CommandCenter -Version 1.0.0
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="CommandCenter" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CommandCenter --version 1.0.0
#r "nuget: CommandCenter, 1.0.0"
#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.
// Install CommandCenter as a Cake Addin
#addin nuget:?package=CommandCenter&version=1.0.0

// Install CommandCenter as a Cake Tool
#tool nuget:?package=CommandCenter&version=1.0.0

CommandRegistry Library

The CommandRegistry library simplifies the implementation and management of commands in applications. This library allows developers to register, describe, and execute commands easily. The registry approach facilitates the integration of new commands, enhancing the flexibility and extensibility of applications.

Features

  • Command Registration: Easily register commands with descriptions and optional parameters.
  • Centralized Command Execution: Provides a central interface for executing commands, promoting code consistency and maintainability.
  • Flexibility: Supports dynamic addition and removal of commands, making it suitable for evolving applications.
  • User Interaction: Ideal for applications requiring a command-line interface or similar interactive control.

Getting Started

Installation

You can download the CommandRegistry library from releases or build it yourself:

Usage

1. Create a commandHandler:

  var commandHandler = new CommandHandler();

2. Add Commands:

  commandHandler.AddCommand(new CommandBuilder("example")
      .SetDescription("Example command")
      .SetAction(parameters =>
      {
          // Command logic here
          Console.WriteLine("Executing the example command!");
      })
      .Build());

3. Add Parameters to command:

    commandProcessor.AddCommand(new CommandBuilder("inject")
        .SetDescription("Description")
        .WithParameter("n", "Description for n")
        .SetAction(parameters =>
        {
            string n = parameters.GetParameterValue("n");

            if (n != null)
            {
                DoSomething(n);
            }
            else
            {
                Console.WriteLine("Missing parameters for the 'n' command. Use -n");
            }
        })
        .Build());

4. Process Commands:

  while (true)
  {
      Console.Write("Enter a command: ");
      string input = Console.ReadLine();
      commandHandler.ProcessCommand(input);
  }
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

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
1.0.0 230 11/15/2023