@@ -41,11 +41,6 @@ namespace CommandLine
41
41
/// </summary>
42
42
public sealed class Parser : IDisposable
43
43
{
44
- ///// <summary>
45
- ///// Default exit code (1) used by <see cref="Parser.ParseArgumentsStrict(string[],object,Action)"/>
46
- ///// and <see cref="Parser.ParseArgumentsStrict(string[],object,Action<string,object>,Action)"/> overloads.
47
- ///// </summary>
48
- //public const int DefaultExitCodeFail = 1;
49
44
private static readonly Parser DefaultParser = new Parser ( true ) ;
50
45
private readonly ParserSettings _settings ;
51
46
private bool _disposed ;
@@ -121,60 +116,6 @@ public static Parser Default
121
116
get { return DefaultParser ; }
122
117
}
123
118
124
- ///// <summary>
125
- ///// Gets the instance that implements <see cref="CommandLine.ParserSettings"/> in use.
126
- ///// </summary>
127
- //public ParserSettings Settings
128
- //{
129
- // get { return _settings; }
130
- //}
131
-
132
- ///// <summary>
133
- ///// Parses a <see cref="System.String"/> array of command line arguments, setting values in <paramref name="options"/>
134
- ///// parameter instance's public fields decorated with appropriate attributes.
135
- ///// </summary>
136
- ///// <param name="args">A <see cref="System.String"/> array of command line arguments.</param>
137
- ///// <param name="options">An instance used to receive values.
138
- ///// Parsing rules are defined using <see cref="CommandLine.BaseOptionAttribute"/> derived types.</param>
139
- ///// <returns>True if parsing process succeed.</returns>
140
- ///// <exception cref="System.ArgumentNullException">Thrown if <paramref name="args"/> is null.</exception>
141
- ///// <exception cref="System.ArgumentNullException">Thrown if <paramref name="options"/> is null.</exception>
142
- //public bool ParseArguments(string[] args, object options)
143
- //{
144
- // Assumes.NotNull(args, "args", SR.ArgumentNullException_ArgsStringArrayCannotBeNull);
145
- // Assumes.NotNull(options, "options", SR.ArgumentNullException_OptionsInstanceCannotBeNull);
146
-
147
- // return DoParseArguments(args, options);
148
- //}
149
-
150
- ///// <summary>
151
- ///// Parses a <see cref="System.String"/> array of command line arguments with verb commands, setting values in <paramref name="options"/>
152
- ///// parameter instance's public fields decorated with appropriate attributes.
153
- ///// This overload supports verb commands.
154
- ///// </summary>
155
- ///// <param name="args">A <see cref="System.String"/> array of command line arguments.</param>
156
- ///// <param name="options">An instance used to receive values.
157
- ///// Parsing rules are defined using <see cref="CommandLine.BaseOptionAttribute"/> derived types.</param>
158
- ///// <param name="onVerbCommand">Delegate executed to capture verb command name and instance.</param>
159
- ///// <returns>True if parsing process succeed.</returns>
160
- ///// <exception cref="System.ArgumentNullException">Thrown if <paramref name="args"/> is null.</exception>
161
- ///// <exception cref="System.ArgumentNullException">Thrown if <paramref name="options"/> is null.</exception>
162
- ///// <exception cref="System.ArgumentNullException">Thrown if <paramref name="onVerbCommand"/> is null.</exception>
163
- //public bool ParseArguments(string[] args, object options, Action<string, object> onVerbCommand)
164
- //{
165
- // Assumes.NotNull(args, "args", SR.ArgumentNullException_ArgsStringArrayCannotBeNull);
166
- // Assumes.NotNull(options, "options", SR.ArgumentNullException_OptionsInstanceCannotBeNull);
167
- // Assumes.NotNull(options, "onVerbCommand", SR.ArgumentNullException_OnVerbDelegateCannotBeNull);
168
-
169
- // object verbInstance = null;
170
-
171
- // var result = DoParseArgumentsVerbs(args, options, ref verbInstance);
172
-
173
- // onVerbCommand(args.FirstOrDefault() ?? string.Empty, result ? verbInstance : null);
174
-
175
- // return result;
176
- //}
177
-
178
119
/// <summary>
179
120
/// Parses a <see cref="System.String"/> array of command line arguments, setting values in <paramref name="options"/>
180
121
/// parameter instance's public fields decorated with appropriate attributes. If parsing fails, the method invokes
@@ -405,7 +346,6 @@ private Tuple<bool,T> DoParseArgumentsCore<T>(string[] args, T options)
405
346
406
347
hadError |= ! optionMap . EnforceRules ( ) ;
407
348
408
- //return !hadError ? options : default(T);
409
349
return new Tuple < bool , T > ( ! hadError , options ) ;
410
350
}
411
351
@@ -457,7 +397,7 @@ private Tuple<bool, T, object> DoParseArgumentsVerbs<T>(string[] args)
457
397
var resultAndVerbInstance = DoParseArgumentsCore ( args . Skip ( 1 ) . ToArray ( ) , verbInstance ) ;
458
398
var result = resultAndVerbInstance . Item1 ;
459
399
verbInstance = resultAndVerbInstance . Item2 ;
460
- //if (verbInstance == null && helpInfo != null)
400
+
461
401
if ( ! result && helpInfo != null )
462
402
{
463
403
// Particular verb parsing failed, we try to print its help
0 commit comments