improved command argument system.
This commit is contained in:
@@ -8,12 +8,7 @@ namespace RecrownedAthenaeum.Tools.CommandProcessor.Commands
|
||||
{
|
||||
public ClearConsoleCommand() : base("clear")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override string Help(string argument = null)
|
||||
{
|
||||
return "Clears the console.";
|
||||
help = "Clears the console.";
|
||||
}
|
||||
|
||||
public override void Run(string[] arguments = null)
|
||||
|
@@ -11,11 +11,7 @@ namespace RecrownedAthenaeum.Tools.CommandProcessor.Commands
|
||||
public HelpCommand(CommandEngine commandEngine) : base("help")
|
||||
{
|
||||
this.commandEngine = commandEngine;
|
||||
}
|
||||
|
||||
public override string Help(string argument)
|
||||
{
|
||||
return "help [command] [arg]";
|
||||
help = "help [command] [arg]";
|
||||
}
|
||||
|
||||
|
||||
@@ -41,10 +37,10 @@ namespace RecrownedAthenaeum.Tools.CommandProcessor.Commands
|
||||
ConsoleUtilities.WriteWrappedLine("Tools for RecrownedAthenaeum library. Possible commands are as follows:\n");
|
||||
foreach (EngineCommand engineCommand in commandEngine.commands)
|
||||
{
|
||||
for (int i = 0; i < engineCommand.invokeStrings.Length; i++)
|
||||
for (int i = 0; i < engineCommand.InvokeStrings.Length; i++)
|
||||
{
|
||||
ConsoleUtilities.WriteWrapped(engineCommand.invokeStrings[i]);
|
||||
if (i + 1 < engineCommand.invokeStrings.Length)
|
||||
ConsoleUtilities.WriteWrapped(engineCommand.InvokeStrings[i]);
|
||||
if (i + 1 < engineCommand.InvokeStrings.Length)
|
||||
{
|
||||
ConsoleUtilities.WriteWrapped(", ");
|
||||
}
|
||||
|
@@ -11,11 +11,7 @@ namespace RecrownedAthenaeum.Tools.CommandProcessor.Commands
|
||||
public StopCommand(CommandEngine commandEngine) : base("quit", "stop", "q", "exit")
|
||||
{
|
||||
this.commandEngine = commandEngine;
|
||||
}
|
||||
|
||||
public override string Help(string argument = null)
|
||||
{
|
||||
return "Exits the tool.";
|
||||
help = "Exits the tool.";
|
||||
}
|
||||
|
||||
public override void Run(string[] arguments = null)
|
||||
|
@@ -1,39 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace RecrownedAthenaeum.Tools.CommandProcessor.Commands
|
||||
{
|
||||
class TestCommand : EngineCommand
|
||||
{
|
||||
public TestCommand() : base("test")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override string Help(string argument = null)
|
||||
{
|
||||
switch (argument)
|
||||
{
|
||||
case null:
|
||||
return "Test command. Meant for testing random stuff. Current arguments: \"-textWrap\".\n" +
|
||||
"Its ironic that the help section is also meant to test things.";
|
||||
case "-textWrap":
|
||||
return "-textWrap prints a large amount of text to test the text wrap.";
|
||||
}
|
||||
return "Test command.";
|
||||
}
|
||||
|
||||
public override void Run(string[] arguments = null)
|
||||
{
|
||||
if (arguments != null && arguments[0] == "-textWrap")
|
||||
{
|
||||
ConsoleUtilities.WriteWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit.[here]\n Duis semper lacinia nisl, eget efficitur massa feugiat vel. Ut egestas elit id sollicitudin pellentesque.[here no space after break.]\nFusce ullamcorper nec turpis at aliquam. Donec cursus mi nec porttitor convallis. Nullam condimentum sollicitudin volutpat. Pellentesque tellus ligula, eleifend sit amet ante ac, accumsan volutpat lorem. Suspendisse potenti. Vestibulum at sodales ipsum. Mauris dignissim maximus purus sagittis elementum.", true);
|
||||
ConsoleUtilities.WriteWrapped("test");
|
||||
ConsoleUtilities.WriteWrapped(". ");
|
||||
ConsoleUtilities.WriteWrapped("test.");
|
||||
}
|
||||
base.Run(arguments);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user