Enum list options not displayed in help text
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện vấn đề với một tùy chọn có kiểu IEnumerable, sử dụng cấu hình Parser và HelpText.AutoBuild được trình bày trong báo cáo. Theo dõi cách AddEnumValuesToHelpText xử lý các kiểu tùy chọn collection; hoàn thành có nghĩa là đầu ra --help được tạo ra bao gồm các giá trị hợp lệ của enum cho các tùy chọn danh sách, đồng thời giữ nguyên hành vi hiện có đối với các enum vô hướng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Apologies if this question/bug was already open
Describe the bug
The property: HelpText.AddenumValuesToHelpText does not work when the option is of type IEnummerable<{Enum}>. I'm guessing the list is masking the fact that its containing an enum.
Is it possible to have the same Valid values: {enum values} in the help text to be displayed when its a list of enums?
To Reproduce
- Create an option of type
IEnummerable<{Enum}> - configure a parser as follows:
var parser = new Parser(with =>
{
with.CaseInsensitiveEnumValues = true;
with.HelpWriter = null;
with.AutoVersion = false;
});
var parserResult = parser.ParseArguments<TArgs>(args.SplitArgs());
parserResult
.WithNotParsed(_ =>
{
var helpText = HelpText.AutoBuild(parserResult, h =>
{
h.AutoVersion = false;
h.Heading = string.Empty;
h.Copyright = string.Empty;
h.AddEnumValuesToHelpText = true;
return h;
});
Console.WriteLine(helpText);
});
- use the --help to find no
Valid values: {enum values}in the help text.
Expected behavior
I expected a list of enums to still show available options
Screenshots
- 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
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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của commandlineparser/commandline
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
commandlineparser/commandline#951 · 1 bình luận ·
-
Code example misses iEnumerable Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
commandlineparser/commandline#880 · 2 reaction ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
commandlineparser/commandline#952 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
commandlineparser/commandline#948 ·
-
How to add examples for verbs? Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
commandlineparser/commandline#947 ·
Tất cả issue của commandlineparser/commandline
Issue tương tự
-
Add more to the documentation Đang mở:watch: Not Triaged dotnet-fsharp/svc
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Azure/azure-sdk-for-net#63292 · 3 bình luận · 1 reaction ·
-
Issue-Enhancement Needs-Triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
PowerShell/PowerShell#28061 · 2 reaction ·
-
dependencies needs-team-triage server-Azure.Mcp
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
aspnet-core/svc aspnetcore-signalr/subsvc doc-enhancement Pri2 SignalR
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
dotnet/AspNetCore.Docs#37729 ·