17 public TerminalCommand(
string commandName,
string shortDescription,
string? longDescription, Func<
string[],
ICommandResult> func, params Option[] args) {
25 public string Name {
get; }
38 return new TaskFactory().StartNew(() =>
executor(args));
Represents a single command that can only be executed on the (interactive) terminal.
string ShortDescription
A short description of the command and its function.
Option[] CommandOptions
A list of options applicable to this command.
TerminalCommand(string commandName, string shortDescription, string? longDescription, Func< string[], ICommandResult > func, params Option[] args)
ICommandResult Execute(params string[] args)
Executes the command and returns a genericised variation of the ICommandResult<T>,...
string Name
The (callable) name for the command.
string? LongDescription
A detailled description of the command and its function.
Func< string[], ICommandResult > executor
Task< ICommandResult > ExecuteAsync(params string[] args)
Asynchronous variation of Execute(string[]).
Specialised variation of ICommand with generic typing.
A generic, object-based variation of ICommandResult<T>.