Skip to content

Commit adb311b

Browse files
XML documentation for Argument<T> class (#1100)
* Add XML documentation to the Argument{T} class
1 parent 347d68d commit adb311b

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/System.CommandLine/Argument{T}.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,22 @@
55

66
namespace System.CommandLine
77
{
8+
///<inheritdoc/>
89
public class Argument<T> : Argument
910
{
11+
/// <summary>
12+
/// Initializes a new instance of the Argument class.
13+
/// </summary>
1014
public Argument()
1115
{
1216
ArgumentType = typeof(T);
1317
}
1418

19+
/// <summary>
20+
/// Initializes a new instance of the Argument class.
21+
/// </summary>
22+
/// <param name="name">The name of the argument.</param>
23+
/// <param name="description">The description of the argument, shown in help.</param>
1524
public Argument(
1625
string name,
1726
string? description = null) : base(name)
@@ -20,6 +29,13 @@ public Argument(
2029
Description = description;
2130
}
2231

32+
/// <summary>
33+
/// Initializes a new instance of the Argument class.
34+
/// </summary>
35+
/// <param name="name">The name of the argument.</param>
36+
/// <param name="getDefaultValue">The delegate to invoke to return the default value.</param>
37+
/// <param name="description">The description of the argument, shown in help.</param>
38+
/// <exception cref="ArgumentNullException">Thrown when <paramref name="getDefaultValue"/> is null.</exception>
2339
public Argument(
2440
string name,
2541
Func<T> getDefaultValue,
@@ -35,6 +51,11 @@ public Argument(
3551
Description = description;
3652
}
3753

54+
/// <summary>
55+
/// Initializes a new instance of the Argument class.
56+
/// </summary>
57+
/// <param name="getDefaultValue">The delegate to invoke to return the default value.</param>
58+
/// <exception cref="ArgumentNullException">Thrown when <paramref name="getDefaultValue"/> is null.</exception>
3859
public Argument(Func<T> getDefaultValue) : this()
3960
{
4061
if (getDefaultValue is null)
@@ -45,6 +66,13 @@ public Argument(Func<T> getDefaultValue) : this()
4566
SetDefaultValueFactory(() => getDefaultValue());
4667
}
4768

69+
/// <summary>
70+
/// Initializes a new instance of the Argument class.
71+
/// </summary>
72+
/// <param name="name">The name of the argument.</param>
73+
/// <param name="parse">A custom argument parser.</param>
74+
/// <param name="isDefault"><c>true</c> to use the <paramref name="parse"/> result as default value.</param>
75+
/// <exception cref="ArgumentNullException">Thrown when <paramref name="parse"/> is null.</exception>
4876
public Argument(
4977
string? name,
5078
ParseArgument<T> parse,
@@ -82,6 +110,11 @@ public Argument(
82110
};
83111
}
84112

113+
/// <summary>
114+
/// Initializes a new instance of the Argument class.
115+
/// </summary>
116+
/// <param name="parse">A custom argument parser.</param>
117+
/// <param name="isDefault"><c>true</c> to use the <paramref name="parse"/> result as default value.</param>
85118
public Argument(ParseArgument<T> parse, bool isDefault = false) : this(null, parse, isDefault)
86119
{
87120
}

0 commit comments

Comments
 (0)