Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Feature Request: Add Examples section in HelpBuilder.

Đang mở
#2,510 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

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

Hướng nghiên cứu

Bắt đầu bằng cách đọc các API của HelpBuilder và CliCommand, sau đó xem lại bài viết được liên kết “Add or replace help sections” để hiểu điểm mở rộng được dự kiến. Xác định cách cấu hình một thuộc tính string Examples cho từng lệnh và hiển thị thuộc tính đó dưới dạng một phần trợ giúp riêng biệt. Được xem là hoàn tất khi phần trợ giúp được tạo có phần examples, đồng thời giữ nguyên đầu ra hiện có của description, usage và options.

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

Mô tả

Area-Help

The current help is generated based on the Description of Command/Option or Argument.
Most of cli tools provide examples in help.
It is needed to add a separate section appended to the current generated help for every Command.
The Examples can be a string property (like Description) in CliCommand to be used in configuring help examples every command.

In the article Add or replace help sections, we can add a new section , but it need to access a property Eg Examples
It is nice of that ExampleSection be part of HelpBuilder class .
Sample of the help with examples:

Description:
  Read a file

Usage:
  scl [options]

Options:
  --file <file>                                               The file to print out. [default: scl.runtimeconfig.json]
  --light-mode                                                Determines whether the background color will be black or
                                                              white
  --color                                                     Specifies the foreground color of console output
  <Black|Blue|Cyan|White>
  --version                                                   Show version information
  -?, -h, --help                                              Show help and usage information
 
Examples:
Example 1: 
scl --file  file.txt --color Cyan
Example 2: Using default color  
scl --file  file.txt
Ngôn ngữ chính
C#
Star
3.7k
Fork
434
Merge trung bình
6 giờ 27 phút
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dotnet/command-line-api

Tất cả issue của dotnet/command-line-api

Issue tương tự

Thêm issue về C#

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.