commandlineparser / commandlineparser/commandline

Global parameters before verbs

オープン
#799 コメント 1 件 リアクション 4 件 担当者 0 名 GitHub で見る
主要言語
C#
スター
4.8k
フォーク
478
PR マージ指標
30日以内にマージされた PR はありません

説明

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?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。