Class Command
Represents a command that can be invoked from the console
Inheritance
System.Object
Command
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: PiTung.Console
Assembly: PiTung.dll
Syntax
public abstract class Command
Properties
| Improve this Doc View SourceAliases
Alternative names for the command.
Declaration
public virtual string[] Aliases { get; }
Property Value
Type | Description |
---|---|
System.String[] |
Description
Short description of what the command does, preferably on 1 line
Declaration
public virtual string Description { get; }
Property Value
Type | Description |
---|---|
System.String |
Name
Used to invoke the command (e.g. "help")
Declaration
public abstract string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Usage
How to use the command (e.g. $"{Name} argument [optional_argument]")
Declaration
public abstract string Usage { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceAutocompletionCandidates(IEnumerable<String>)
Called when the auto-completion is triggered
Declaration
public virtual IEnumerable<string> AutocompletionCandidates(IEnumerable<string> arguments)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | arguments | The arguments to the command, the last one needing auto-completion |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | The auto-completion candidates for the last argument |
Execute(IEnumerable<String>)
Called when the command is invoked
Declaration
public abstract bool Execute(IEnumerable<string> arguments)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | arguments | The arguments given to the command |
Returns
Type | Description |
---|---|
System.Boolean | False if the command was malformed (i.e., the command requires 2 arguments but only 1 was supplied). |