Skip to content

Add arguments to OptionAttribute so MutuallyExclusiveSet can be set #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/libcmdline/CommandLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ public class OptionAttribute : BaseOptionAttribute
/// Initializes a new instance of the <see cref="CommandLine.OptionAttribute"/> class.
/// </summary>
/// <param name="shortName">The short name of the option or null if not used.</param>
/// <param name="longName">The long name of the option or null if not used.</param>
public OptionAttribute(string shortName, string longName)
/// <param name="longName">The long name of the option or null if not used.</param>
/// <param name="mutuallyExclusiveSet">The option's mutually exclusive set</param>
public OptionAttribute(string shortName = null, string longName = null, string mutuallyExclusiveSet = null)
{
if (!string.IsNullOrEmpty(shortName))
_uniqueName = shortName;
Expand All @@ -213,7 +214,9 @@ public OptionAttribute(string shortName, string longName)
throw new InvalidOperationException();

base.ShortName = shortName;
base.LongName = longName;
base.LongName = longName;
if (mutuallyExclusiveSet != null)
MutuallyExclusiveSet = mutuallyExclusiveSet;
}

#if UNIT_TESTS
Expand Down