We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 496fd6b commit f31607dCopy full SHA for f31607d
ProgramArgumentsManager/ArgumentsManager.cs
@@ -102,14 +102,23 @@ public void Parse(string[] args)
102
string lastArg = null;
103
foreach (string arg in args)
104
{
105
- if (IsArgument(arg))
+ try
106
107
- lastArg = arg;
108
- _options[lastArg].Specified = true;
+ if (IsArgument(arg))
+ {
109
+ lastArg = arg;
110
+ _options[lastArg].Specified = true;
111
+ }
112
+ else
113
114
+ _options[lastArg].Values.Add(arg);
115
116
}
- else
117
+ catch (KeyNotFoundException)
118
- _options[lastArg].Values.Add(arg);
119
+ int i = lastArg is null ?
120
+ throw new FirstNoArgumentException($"The first command ({arg}) isn't an argument !") :
121
+ throw new UnknownArgumentException(lastArg, $"{lastArg} doesn't exist !");
122
123
124
0 commit comments