Skip to content

Commit 8d3045f

Browse files
committed
Fixes issue #1
1 parent 08b3ae6 commit 8d3045f

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Program.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,17 @@ public static List<ProgramArgs> ParseArgs(string[] args) {
5050
});
5151
} else {
5252
var spaceIndex = arg.IndexOf(' ');
53-
res.Add(new ProgramArgs {
54-
ExeName = arg.Substring(0, spaceIndex),
55-
Arguments = arg.Substring(spaceIndex + 1)
56-
});
53+
if (spaceIndex < 0) {
54+
res.Add(new ProgramArgs {
55+
ExeName = arg,
56+
Arguments = ""
57+
});
58+
} else {
59+
res.Add(new ProgramArgs {
60+
ExeName = arg.Substring(0, spaceIndex),
61+
Arguments = arg.Substring(spaceIndex + 1).Trim()
62+
});
63+
}
5764
}
5865
}
5966
return res;

0 commit comments

Comments
 (0)