namespace Brutal.ImGuiApi.Abstractions;
///
/// Defines how a terminal action should be parsed
///
public enum ArgParseMode
{
///
/// Parse the command string args into individual tokens, considering whitespace and quotes
///
Default,
///
/// Output the raw unparsed command arg string
///
Unparsed,
}
///
/// An attribute which is used to define methods that can be registered as callback through a TerminalInterface
///
[AttributeUsage(AttributeTargets.Method)]
public class TerminalActionAttribute : Attribute
{
/// The command name
/// A description of the command
/// The type of parsing which should be used on the command
public TerminalActionAttribute(
string commandName,
string description = "",
ArgParseMode parsingMode = ArgParseMode.Default
)
{
CommandName = commandName.ToLower();
Description = description;
ParsingMode = parsingMode;
}
///
/// The name of the command
///
public string CommandName { get; }
///
/// A description of the command
///
public string Description { get; }
///
/// The parsing mode of the command
///
public ArgParseMode ParsingMode { get; }
}