commandlineparser / commandlineparser/commandline

Selecting ONLY ONE OPTION in a Group

Offen
#707 0 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C#
Sterne
4.8k
Forks
478
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

From my understanding, in a group there needs to be atleast one or more than one option specified. In my use case, for the class given below, I want to select **only ONE option (not more)**. Is there any way to do this?

```csharp
internal class TimeFrameOptions
{
[Option(shortName: 's', longName: "seconds", Group = "timeframe", HelpText = "")]
public int Seconds { get; set; }

[Option(shortName: 'm', longName: "minutes", Group = "timeframe", HelpText = "")]
public int Minutes { get; set; }

[Option(shortName: 'h', longName: "hours", Group = "timeframe", HelpText = "")]
public int Hours { get; set; }

[Option(shortName: 'd', longName: "days", Group = "timeframe", HelpText = "")]
public int Days { get; set; }
}
```
Thanks

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.