commandlineparser / commandlineparser/commandline

Why "Zero is not allowed in range of sequence option specifications"?

Đang mở
#722 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C#
Star
4.8k
Fork
478
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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;
}

```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Tái hiện ngoại lệ với lớp Options được cung cấp, tập trung vào khai báo [Option('t', "types", Min = 0, Max = 6)] và thuộc tính IEnumerable của nó. Không có tệp nguồn hoặc bài kiểm thử nào được nêu tên, vì vậy hãy lần theo điểm vào của quá trình xác thực tùy chọn và xác định hành vi hoặc định nghĩa nào nên được xem là đã được sửa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
csharp
Lĩnh vực
cli
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.