added CommandAndParameterParser testing and fixed bugs within it

This commit is contained in:
Lukasz Baldyga committed 2020-10-22 20:53:57 +01:00
1 parent f198b609f2
commit 8a17d77510
2 files changed
+76 -12

No files matched your search

@@ -98,8 +98,12 @@ namespace Advanced_Software_Engineering {
public static Dictionary<string, string[]> CommandAndParameterParser(string text) {
Dictionary<string, string[]> commandAndParameters = new Dictionary<string, string[]>();
//prepare the parameters by stripping them of spaces
string prepParameters = Strip(text);
if (prepParameters.Length == 0) return commandAndParameters;
//split the command from the parameters
string[] parameters = Strip(text).Split(new char[] { " "[0] }, 2);
string[] parameters = prepParameters.Split(new char[] { " "[0] }, 2);
//There are parameters, make the command
if (parameters.Length > 0) {