5
5
6
6
namespace System . CommandLine
7
7
{
8
+ ///<inheritdoc/>
8
9
public class Argument < T > : Argument
9
10
{
11
+ /// <summary>
12
+ /// Initializes a new instance of the Argument class.
13
+ /// </summary>
10
14
public Argument ( )
11
15
{
12
16
ArgumentType = typeof ( T ) ;
13
17
}
14
18
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>
15
24
public Argument (
16
25
string name ,
17
26
string ? description = null ) : base ( name )
@@ -20,6 +29,13 @@ public Argument(
20
29
Description = description ;
21
30
}
22
31
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>
23
39
public Argument (
24
40
string name ,
25
41
Func < T > getDefaultValue ,
@@ -35,6 +51,11 @@ public Argument(
35
51
Description = description ;
36
52
}
37
53
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>
38
59
public Argument ( Func < T > getDefaultValue ) : this ( )
39
60
{
40
61
if ( getDefaultValue is null )
@@ -45,6 +66,13 @@ public Argument(Func<T> getDefaultValue) : this()
45
66
SetDefaultValueFactory ( ( ) => getDefaultValue ( ) ) ;
46
67
}
47
68
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>
48
76
public Argument (
49
77
string ? name ,
50
78
ParseArgument < T > parse ,
@@ -82,6 +110,11 @@ public Argument(
82
110
} ;
83
111
}
84
112
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>
85
118
public Argument ( ParseArgument < T > parse , bool isDefault = false ) : this ( null , parse , isDefault )
86
119
{
87
120
}
0 commit comments