Skip to content

Commit 14175ac

Browse files
XML documentation for CommandLineConfiguration class (#1107)
* Add XML documentation to the CommandLineConfiguration class
1 parent adb311b commit 14175ac

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

src/System.CommandLine/CommandLineConfiguration.cs

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,29 @@
1111

1212
namespace System.CommandLine
1313
{
14+
/// <summary>
15+
/// Represents the configuration used by the <see cref="Parser"/>.
16+
/// </summary>
1417
public class CommandLineConfiguration
1518
{
1619
private readonly IReadOnlyCollection<InvocationMiddleware> _middlewarePipeline;
1720
private readonly Func<BindingContext, IHelpBuilder> _helpBuilderFactory;
1821
private readonly SymbolSet _symbols = new SymbolSet();
1922

23+
/// <summary>
24+
/// Initializes a new instance of the CommandLineConfiguration class.
25+
/// </summary>
26+
/// <param name="symbols">The symbols to parse.</param>
27+
/// <param name="argumentDelimiters">The characters used to delimit an option from its argument. In addition to
28+
/// one or more spaces, the default delimiters include <c>:</c> and <c>=</c>.</param>
29+
/// <param name="enablePosixBundling"><c>true</c> to enable POSIX bundling; otherwise, <c>false</c>.</param>
30+
/// <param name="enableDirectives"><c>true</c> to enable directive parsing; otherwise, <c>false</c>.</param>
31+
/// <param name="validationMessages">Provide custom validation messages.</param>
32+
/// <param name="responseFileHandling">One of the enumeration values that specifies how response files (.rsp) are handled.</param>
33+
/// <param name="middlewarePipeline">Provide a custom middleware pipeline.</param>
34+
/// <param name="helpBuilderFactory">Provide a custom help builder.</param>
35+
/// <exception cref="ArgumentNullException">Thrown when <paramref name="symbols"/> is null.</exception>
36+
/// <exception cref="ArgumentException">Thrown when <paramref name="symbols"/> does not contain at least one option or command.</exception>
2037
public CommandLineConfiguration(
2138
IReadOnlyCollection<Symbol> symbols,
2239
IReadOnlyList<char>? argumentDelimiters = null,
@@ -75,7 +92,7 @@ public CommandLineConfiguration(
7592
}
7693
else
7794
{
78-
// reuse existing auto-generated root command, if one is present, to prevent repeated mutations
95+
// Reuse existing auto-generated root command, if one is present, to prevent repeated mutations
7996
RootCommand? parentRootCommand =
8097
symbols.SelectMany(s => s.Parents)
8198
.OfType<RootCommand>()
@@ -125,22 +142,43 @@ private void AddGlobalOptionsToChildren(Command parentCommand)
125142
}
126143
}
127144

145+
/// <summary>
146+
/// Represents all of the symbols to parse.
147+
/// </summary>
128148
public ISymbolSet Symbols => _symbols;
129149

150+
/// <summary>
151+
/// Represents all of the argument delimiters.
152+
/// </summary>
130153
public IReadOnlyList<char> ArgumentDelimiters => ArgumentDelimitersInternal;
131154

132155
internal IReadOnlyList<char> ArgumentDelimitersInternal { get; }
133156

157+
/// <summary>
158+
/// Gets whether directives are enabled.
159+
/// </summary>
134160
public bool EnableDirectives { get; }
135161

162+
/// <summary>
163+
/// Gets whether POSIX bundling is enabled.
164+
/// </summary>
165+
/// <remarks>
166+
/// POSIX recommends that single-character options be allowed to be specified together after a single <c>-</c> prefix.
167+
/// </remarks>
136168
public bool EnablePosixBundling { get; }
137169

170+
/// <summary>
171+
/// Gets the validation messages.
172+
/// </summary>
138173
public ValidationMessages ValidationMessages { get; }
139174

140175
internal Func<BindingContext, IHelpBuilder> HelpBuilderFactory => _helpBuilderFactory;
141176

142177
internal IReadOnlyCollection<InvocationMiddleware> Middleware => _middlewarePipeline;
143178

179+
/// <summary>
180+
/// Gets the root command.
181+
/// </summary>
144182
public ICommand RootCommand { get; }
145183

146184
internal ResponseFileHandling ResponseFileHandling { get; }

0 commit comments

Comments
 (0)