Merge pull request #1532 from Pryaxis/cmdline-fix

Updates the commandline parser to not be broken.
This commit is contained in:
Chris 2017-12-10 14:23:33 +10:30 committed by GitHub
commit f689d77a5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -21,6 +21,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
* Fixed /savessc not bothering to save ssc data for people who bypass ssc. (@hakusaro)
* Default permission sets for new databases are more modern. (@hakusaro)
* Added the ability to ban by account name instead of just banning a character name assuming its an account name. (@hakusaro)
* Fixed a bug in the CommandLineParser which caused some command lines to fail (@QuicM)
* Renamed TShock.DB.User to TShock.DB.UserAccount, including all the related methods, classes and events. (@Ryozuki)
* Update OTAPI to 2.0.0.31, which also updates Newtonsoft.Json to 10.0.3 (@Ryozuki)
* Fixed DumpItems() from trying to dump older versions of certain items (negative item IDs). (@Zaicon)

View file

@ -165,10 +165,16 @@ namespace TShockAPI.CLI
{
_source = source;
for (int i = 0; i < (source.Length - 1 == 0 ? 1 : source.Length - 1); i++)
for (int i = 0; i < (source.Length - 1 == 0 ? 1 : source.Length); i++)
{
string flag = source[i].ToLowerInvariant();
string argument = null;
if (string.IsNullOrWhiteSpace(flag))
{
continue;
}
if (i + 1 < source.Length)
{
argument = source[i + 1];