commandlineparser / commandlineparser/commandline

Global parameters before verbs

Offen
#799 1 Kommentar 4 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

So I want to do something like this:
```bash
$ app.exe
```
First argument is a value, and I want to make it global for every verb in app. For now it is implemented like this:
```c#
abstract class BaseOptions
{
[Value(0)]
public string file { get; set; }
}

[Verb("verb1")]
class Verb1Options : BaseOptions
{
[Option('a', "verb-1-option")]
public bool a{ get; set; }

[Option('b', "verb-1-another-option")]
public bool a{ get; set; }
}

[Verb("verb2")]
class Verb2Options : BaseOptions
{
[Option('c', "verb-2-option")]
public bool c{ get; set; }
}
```
But the issue is first goes verb then value. I need in reverse Can I do it?

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.