EasyCommands 1.2.5.1
See the version list below for details.
dotnet add package EasyCommands --version 1.2.5.1
NuGet\Install-Package EasyCommands -Version 1.2.5.1
<PackageReference Include="EasyCommands" Version="1.2.5.1" />
paket add EasyCommands --version 1.2.5.1
#r "nuget: EasyCommands, 1.2.5.1"
// Install EasyCommands as a Cake Addin #addin nuget:?package=EasyCommands&version=1.2.5.1 // Install EasyCommands as a Cake Tool #tool nuget:?package=EasyCommands&version=1.2.5.1
Easy Commands
Easy Commands is a C# library that lets you easily write a command-line UI. This is particularly useful for use cases such as modded game servers; chat bots on Discord, Twitch, etc.; and any other place where you'd want to convert a text command to an action. This project is also extendable enough to allow custom permission systems, custom command arguments, and anything else you'd want to use.
To install, simply go to Visual Studio's Package Manager Console and type Install-Package EasyCommands
.
To specify a command, all you have to do is implement the abstract CommandHandler
class and write out your command callbacks with this syntax:
[Command("add")]
// You can call this with `add 1 2`
public void Add(int num1, int num2)
{
Console.WriteLine($"{num1} + {num2} = {num1 + num2}");
}
// You can parse any object type you want, as long as you define the behavior for it.
// You can call this with `permission-level John`
// Or with quotes, `permission-level "Betty Sue"`
[Command("permission-level")]
public void GetPermissionLevel(User user)
{
Console.WriteLine($"{user.Name} has the permission level of {user.PermissionLevel}.");
}
Essentially, the arguments of your method specify the arguments of the command. It also supports optional parameters, subcommands, and much more. To read more about usage, visit the documentation. The Example project also demonstrates all of this library's functionality.
Product | Versions 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. |
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
This package has no dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on EasyCommands:
Package | Downloads |
---|---|
EasyCommandsTShock
Simplifies writing commands for TShock plugins |
GitHub repositories
This package is not used by any popular GitHub repositories.
Allow multiple levels of inheritance with command repositories