Jitesoft.Commands 1.0.0

A command manager which is intended to handle parsing and execution of CLI commands.

There is a newer version of this package available.
See the version list below for details.
Install-Package Jitesoft.Commands -Version 1.0.0
dotnet add package Jitesoft.Commands --version 1.0.0
<PackageReference Include="Jitesoft.Commands" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Jitesoft.Commands --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Jitesoft.Commands

This package contains base interface and classes to create command classes which will be managed by the Jitesoft.Commands.Manager.
The intended usage is to pass the arguments from the main method as a list into the manager.Invoke(...) method for it to parse incomming CLI commands.

Each command need to implement the ICommand interface, when created it should specify the arguments and optional flags. The name will be used upon handling the invokation.
When a command is called, its HandleAsync method will be invoked. The manager expects this to be an async operation and will await the result. The result is expected to be of string value.
The parameters passed to the HandleAsync method is two lists, the first one contains all arguments that where passed and the second all the options. The objects uses the same classes as the defined arguments and options in the
command implementation, but with the values set in case of a value.

Example

Invoking the manager from main method.

class Program {
  
  int main(string[] args) {
    string result = manager.Invoke(args.ToList()).GetAwaiter().GetResult();

    Console.Write(result);
    Console.ReadKey(true);
  }

}

More examples will come soon.

Jitesoft.Commands

This package contains base interface and classes to create command classes which will be managed by the Jitesoft.Commands.Manager.
The intended usage is to pass the arguments from the main method as a list into the manager.Invoke(...) method for it to parse incomming CLI commands.

Each command need to implement the ICommand interface, when created it should specify the arguments and optional flags. The name will be used upon handling the invokation.
When a command is called, its HandleAsync method will be invoked. The manager expects this to be an async operation and will await the result. The result is expected to be of string value.
The parameters passed to the HandleAsync method is two lists, the first one contains all arguments that where passed and the second all the options. The objects uses the same classes as the defined arguments and options in the
command implementation, but with the values set in case of a value.

Example

Invoking the manager from main method.

class Program {
  
  int main(string[] args) {
    string result = manager.Invoke(args.ToList()).GetAwaiter().GetResult();

    Console.Write(result);
    Console.ReadKey(true);
  }

}

More examples will come soon.

  • .NETStandard 2.0

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.0 233 5/31/2018
1.0.1 216 5/31/2018
1.0.0 280 5/30/2018