commandlineparser / commandlineparser/commandline

Support + (plus) sign for flags to UNSET a flag often used by Linux

Aperta
#833 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C#
Stelle
4.8k
Fork
478
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

>All of the single letter options that have a corresponding name can be used as an argument to the -o option. The set -o name is provided next to the single letter option in the description below. Specifying a dash “-” turns the option on, while using a plus “+” disables the option.

Meaning, assume you have the following option:

[Option('x', "XXXX", Required = false, Default = true)]
public bool X { get; set; }

And you would pass `+x`, then the result should be `False`:

app.exe +x

This seems like a better approach then a nullable bool:

[Option('x', "XXXX", Required = false, Default = true)]
public bool? X { get; set; }

As that requires to pass:

app.exe -x false

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.