Hermod
A cross-platform, modular and fully GDPR-compliant email archival solution!
Loading...
Searching...
No Matches
ICommand.cs
Go to the documentation of this file.
1using System;
2
4
5 using Results;
6
7 using getopt.net;
8
9 public interface ICommand {
10
14 string Name { get; }
15
19 string ShortDescription { get; }
20
24 string? LongDescription { get; }
25
29 Option[] CommandOptions { get; }
30
34 ICommandResult Execute(params string[] args);
35
41 Task<ICommandResult> ExecuteAsync(params string[] args);
42
43 }
44
49 public interface ICommand<T>: ICommand {
50
56 new ICommand<T> Execute(params string[] args);
57
63 new Task<ICommandResult<T>> ExecuteAsync(params string[] args);
64
65 }
66}
67
Specialised variation of ICommand with generic typing.
Definition: ICommand.cs:49
string? LongDescription
A detailled description of the command and its function.
Definition: ICommand.cs:24
Option[] CommandOptions
A list of options applicable to this command.
Definition: ICommand.cs:29
string Name
The (callable) name for the command.
Definition: ICommand.cs:14
string ShortDescription
A short description of the command and its function.
Definition: ICommand.cs:19
new Task< ICommandResult< T > > ExecuteAsync(params string[] args)
Asynchronous variation of Execute(string[]).
new ICommand< T > Execute(params string[] args)
Overrides the default implementation of ICommand with a generic type approach.
ICommandResult Execute(params string[] args)
Executes the command and returns a genericised variation of the ICommandResult<T>,...
Task< ICommandResult > ExecuteAsync(params string[] args)
Asynchronous variation of Execute(string[]).
A generic, object-based variation of ICommandResult<T>.