From 8de9d86370a36fe88e77b66e4b53f3720be37fbe Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Sun, 9 Dec 2018 14:09:40 -0600 Subject: [PATCH] added one time use path for script use. --- RecrownedAthenaeum.ConsoleTools/Tools.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/RecrownedAthenaeum.ConsoleTools/Tools.cs b/RecrownedAthenaeum.ConsoleTools/Tools.cs index 681e90c..ae68471 100644 --- a/RecrownedAthenaeum.ConsoleTools/Tools.cs +++ b/RecrownedAthenaeum.ConsoleTools/Tools.cs @@ -2,6 +2,7 @@ using RecrownedAthenaeum.Tools.TextureAtlasTools; using System; using System.Reflection; +using System.Text; namespace RecrownedAthenaeum.Tools { @@ -10,7 +11,6 @@ namespace RecrownedAthenaeum.Tools static void Main(string[] args) { CommandEngine ce = new CommandEngine(); - ConsoleUtilities.WriteWrappedLine("Recrowned Athenaeum Console Tools version " + Assembly.GetExecutingAssembly().GetName().Version.ToString()); ConsoleUtilities.WriteWrappedLine("Type \"help\" for help."); @@ -18,7 +18,17 @@ namespace RecrownedAthenaeum.Tools ce.commands.Add(new TexturePackerCommand()); ce.commands.Add(new StopCommand(ce)); ce.commands.Add(new TestCommand()); - ce.Run(); + + if (args != null) + { + ConsoleUtilities.WriteWrappedLine("Executing as one time use."); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < args.Length; i++) sb.Append(args[i] + ' '); + ce.Process(sb.ToString().Trim()); + } else + { + ce.Run(); + } } } }