From 81801746e19c36aa3b18e271cd099ab3a0f6fc07 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Sat, 29 Dec 2018 01:09:35 -0600 Subject: [PATCH] Clarified help message. --- .../CommandProcessor/EngineCommand.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/RecrownedAthenaeum.ConsoleTools/CommandProcessor/EngineCommand.cs b/RecrownedAthenaeum.ConsoleTools/CommandProcessor/EngineCommand.cs index 4a272cd..ff9c21e 100644 --- a/RecrownedAthenaeum.ConsoleTools/CommandProcessor/EngineCommand.cs +++ b/RecrownedAthenaeum.ConsoleTools/CommandProcessor/EngineCommand.cs @@ -89,14 +89,17 @@ namespace RecrownedAthenaeum.Tools.CommandProcessor /// The index or throws argument exception if it doesn't exist. public int IndexOfArgumentIn(string argument, string[] arguments) { - for (int i = 0; i < arguments.Length; i++) + if (arguments != null) { - if (arguments[i] == argument) + for (int i = 0; i < arguments.Length; i++) { - return i; + if (arguments[i] == argument) + { + return i; + } } } - throw new ArgumentException("Argument " + argument + " is missing. Type \"help\" for more information."); + throw new ArgumentException("Expected argument " + argument + " is missing. Type \"help\" for more information."); } public bool HasArgument(string argument, string[] arguments)