From 2becab230ef5497c82bccb42ca5ef9c4f3a20c2a Mon Sep 17 00:00:00 2001 From: Webber Date: Sun, 1 Dec 2019 00:40:13 +0100 Subject: [PATCH] Fix off by one --- test-project/Assets/Editor/Builder.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test-project/Assets/Editor/Builder.cs b/test-project/Assets/Editor/Builder.cs index 0cac0879..0442b841 100644 --- a/test-project/Assets/Editor/Builder.cs +++ b/test-project/Assets/Editor/Builder.cs @@ -13,8 +13,14 @@ static class Builder providedArguments = new Dictionary(); string[] args = Environment.GetCommandLineArgs(); + // Output args in console + Debug.Log("Arguments given: "); + foreach (string arg in args) { + Debug.Log(arg); + } + // Extract flags with optional values - for (int current = 0, next = 1; current <= args.Length; current++, next++) { + for (int current = 0, next = 1; current < args.Length; current++, next++) { // Parse flag bool isFlag = args[current].StartsWith("-"); if (!isFlag) continue;