Skip to content
Browse files

Generator.Bind: Fixed bug when using value less options such as --help.

  • Loading branch information...
1 parent 90dac03 commit 5a2d7e407c934706f9065876b07f8f702daf70b3 @hultqvist committed Apr 20, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 Source/Bind/Main.cs
View
6 Source/Bind/Main.cs
@@ -66,7 +66,11 @@ static void Main(string[] arguments)
if (match.Success)
{
string opt = match.Value.Substring(1).Trim();
- string val = a.Substring(match.Value.Length + 1).Trim();
+ string val = "";
+ //Only if option has a value
+ if (a.Length > match.Length)
+ val = a.Substring(match.Value.Length + 1).Trim();
+
switch (opt)
{
case "?":

0 comments on commit 5a2d7e4

Please sign in to comment.
Something went wrong with that request. Please try again.