Skip to content

Commit 06fcda7

Browse files
committed
Ignore required rules when group specification has group option set.
1 parent 1fe68f0 commit 06fcda7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/CommandLine/Core/SpecificationPropertyRules.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ where sp.Specification.Required
101101
where sp.Value.IsNothing()
102102
let o = (OptionSpecification)sp.Specification
103103
where o.SetName.Length > 0
104+
where o.Group.IsNothing()
104105
where setWithRequiredValue.ContainsIfNotEmpty(o.SetName)
105106
select sp.Specification;
106107
var missing =
@@ -113,6 +114,7 @@ where sp.Specification.Required
113114
where sp.Value.IsNothing()
114115
let o = (OptionSpecification)sp.Specification
115116
where o.SetName.Length == 0
117+
where o.Group.IsNothing()
116118
select sp.Specification)
117119
.Concat(
118120
from sp in specProps

src/CommandLine/OptionAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public char Separator
107107
}
108108

109109
/// <summary>
110-
/// Gets or sets the option group name. When one or more options are grouped, at least one of them should have value.
110+
/// Gets or sets the option group name. When one or more options are grouped, at least one of them should have value. Required rules are ignored.
111111
/// </summary>
112112
public string Group
113113
{

0 commit comments

Comments
 (0)