From c17af2248ad7ecee20edf9800de62add234b8f40 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Sat, 8 Dec 2018 21:28:58 -0600 Subject: [PATCH] added help for commands. --- .../CommandProcessor/ICommandEngineCommand.cs | 12 ++++++++++++ .../TextureAtlasTools/TexturePackerCommand.cs | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/RecrownedAthenaeum.ConsoleTools/CommandProcessor/ICommandEngineCommand.cs b/RecrownedAthenaeum.ConsoleTools/CommandProcessor/ICommandEngineCommand.cs index 703f0e1..e71744e 100644 --- a/RecrownedAthenaeum.ConsoleTools/CommandProcessor/ICommandEngineCommand.cs +++ b/RecrownedAthenaeum.ConsoleTools/CommandProcessor/ICommandEngineCommand.cs @@ -6,6 +6,18 @@ namespace RecrownedAthenaeum.Tools.CommandProcessor { interface ICommandEngineCommand { + /// + /// Runs the command. + /// + /// Commands to be used. May be null. void Run(string[] arguments); + + /// + /// Returns the help for the given argument. + /// If no argument is given (null), then returns overall help statement. + /// + /// The argument the help string is for. Can be null for overall command help. + /// The text to help understand the argument. + string Help(string argument); } } diff --git a/RecrownedAthenaeum.ConsoleTools/TextureAtlasTools/TexturePackerCommand.cs b/RecrownedAthenaeum.ConsoleTools/TextureAtlasTools/TexturePackerCommand.cs index 8206a80..c591f60 100644 --- a/RecrownedAthenaeum.ConsoleTools/TextureAtlasTools/TexturePackerCommand.cs +++ b/RecrownedAthenaeum.ConsoleTools/TextureAtlasTools/TexturePackerCommand.cs @@ -10,6 +10,15 @@ namespace RecrownedAthenaeum.Tools.TextureAtlasTools class TexturePackerCommand : ICommandEngineCommand { TexturePacker texturePacker; + + public string Help(string argument) + { + return "Packs a given directory composed of png and jpg files into an atlas. Can also add 9patch properties.\n" + + "-i path for input directory containing the textures. Required." + + "-o path for output files. Should point to a non-existent file with no extension as the extension will be created for both the atlas definition file and texture file. Required.\n" + + "-9p can be used multiple times for defining a 9patch. This parameter requires a name, left patch, right patch, top patch, and bottom patch in the format name,a,b,c,d. Optional."; + } + public void Run(string[] arguments) { for (int i = 0; i < arguments.Length; i++)