Skip to content

Commit 93f7849

Browse files
committed
handle missing "" from output path with spaces (show error) fixes #7
1 parent 9a6c6cc commit 93f7849

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Tools/ArgParser.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ static string[] SplitArgs(string unsplitArgumentLine)
4242
// ptrToSplitArgs is an array of pointers to null terminated Unicode strings.
4343
// Copy each of these strings into our split argument array.
4444
for (int i = 0; i < numberOfArgs; i++)
45+
{
4546
splitArgs[i] = Marshal.PtrToStringUni(Marshal.ReadIntPtr(ptrToSplitArgs, i * IntPtr.Size));
47+
}
4648

4749
return splitArgs;
4850
}
@@ -84,7 +86,6 @@ static string GetEscapedCommandLine()
8486

8587
public static ImportSettings Parse(string[] args, string rootFolder)
8688
{
87-
8889
ImportSettings importSettings = new ImportSettings();
8990

9091
// if there are any errors, they are added to this list, then importing is aborted after parsing arguments
@@ -570,11 +571,15 @@ public static ImportSettings Parse(string[] args, string rootFolder)
570571
break;
571572

572573
default:
573-
errors.Add("Unrecognized option: " + cmd + argValueSeparator + param);
574+
errors.Add("Unrecognized argument: " + cmd + argValueSeparator + param);
574575
break;
575-
}
576+
} // switch
576577
}
577-
}
578+
else // bad arg (often due to missing "" around path with spaces)
579+
{
580+
errors.Add("Unknown argument: " + cmds[0]);
581+
}
582+
} // for args
578583
}
579584
else // if no commandline args
580585
{

0 commit comments

Comments
 (0)