commandlineparser / commandlineparser/commandline
Why "Zero is not allowed in range of sequence option specifications"?
- 主要言語
- C#
- スター
- 4.8k
- フォーク
- 478
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
I have used the old version of the CommandlineParser and it worked fine.
Now I have upgraded my console app to the latest Nuget, run the app and receive:
`System.InvalidOperationException: 'Zero is not allowed in range of sequence option specifications.'`
I have detected that option 't' is the reason of the exception.
How to fix it?
There is my definition
```
class Options
{
[Option('i', "input", Required = true, HelpText = "Input folder/file to be processed.")]
public string InputFolder { get; set; }
[Option('x', "xfiles", Required = false, HelpText = "Exclude files to be processed.")]
public IEnumerable ExcludeFiles { get; set; }
[Option('t', "types", Required = false, Min =0, Max=6,HelpText = "Exclude file extensions to be processed.")]
public IEnumerable ExcludeFileExtensions { get; set; }
[Value(0)]
public int Offset { get; set; } = 0;
}
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
提供された Options クラスを使って例外を再現し、[Option('t', "types", Min = 0, Max = 6)] の宣言とその IEnumerable プロパティに注目してください。ソースファイルもテストも指定されていないため、オプション検証のエントリポイントを追跡し、どの動作または定義を修正済みとみなすべきかを判断してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- csharp
- 領域
- cli
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 30/100