commandlineparser / commandlineparser/commandline

Set to true nullable bool arguments without the value

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

Beschreibung

Consider the following class:

```csharp
class Parameters
{
[Option("bool")]
public bool Bool { get; set; }

[Option("nullable-bool")]
public bool? NullableBool { get; set; }
}
```

It works fine for such arguments: `--bool --nullable-bool true` but doesn't work for `--bool --nullable-bool`.

I suggest making it working for nullable bool types.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Reproduce the behavior with the Parameters class shown in the issue, comparing `--bool --nullable-bool true` with `--bool --nullable-bool`. Trace the command-line option parsing path for nullable bool properties; done means `--nullable-bool` sets NullableBool to true without requiring an explicit value, while existing boolean behavior remains intact.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

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