Resolved a bug in CommandLineParser,

which caused servers started with a single argumentless flag to not parse the flag.
Closes #1411
This commit is contained in:
White 2017-03-19 10:06:45 +10:30
parent 0bb704a845
commit 42c7a2b030

View file

@ -165,10 +165,14 @@ namespace TShockAPI.CLI
{
_source = source;
for (int i = 0; i < source.Length - 1; i++)
for (int i = 0; i < (source.Length - 1 == 0 ? 1 : source.Length - 1); i++)
{
string flag = source[i].ToLowerInvariant();
string argument = source[i + 1];
string argument = null;
if (i + 1 < source.Length)
{
argument = source[i + 1];
}
FlagSet flags = _flags.FirstOrDefault(f => f.Contains(flag));
if (flags == null)