How to approach --help implementation
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu bằng việc xem xét triển khai cmp được tham chiếu trong pull request #88 và so sánh hành vi hiện tại trên dòng lệnh của nó với đầu ra trợ giúp của GNU cmp được hiển thị ở đây. Xác định xem phần trợ giúp nên tuân theo cách diễn đạt của GNU hay được viết độc lập, sau đó định nghĩa cách áp dụng quyết định này cho các công cụ diffutils khác; issue không nêu tên các tệp hoặc bài kiểm thử cần chạy.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I am working on the cmp implementation (https://github.com/uutils/diffutils/pull/88) and would like to have --help output something useful, which I think is important for our version to really replace GNU cmp on a system. We should figure out which way to go here so that we can apply it to the other diffutils tools.
I believe we have 2 main options:
- Basically copy/paste GNU cmp output, with minimal changes
- Write from scratch
Option 1 has the benefit of being familiar for people who are used to the GNU tooling, or for those crazy enough to have scripted parsing of this output, for some reason. I suppose the main concern for doing it like this is an argument could be made that the output is copyrighted. This is how I envision it looking (note the different links at the bottom):
print!(
indoc! {"
Usage: {} [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]
Compare two files byte by byte.
The optional SKIP1 and SKIP2 specify the number of bytes to skip
at the beginning of each file (zero by default).
Mandatory arguments to long options are mandatory for short options too.
-b, --print-bytes print differing bytes
-i, --ignore-initial=SKIP skip first SKIP bytes of both inputs
-i, --ignore-initial=SKIP1:SKIP2 skip first SKIP1 bytes of FILE1 and
first SKIP2 bytes of FILE2
-l, --verbose output byte numbers and differing byte values
-n, --bytes=LIMIT compare at most LIMIT bytes
-s, --quiet, --silent suppress all normal output
--help display this help and exit
-v, --version output version information and exit
SKIP values may be followed by the following multiplicative suffixes:
kB 1000, K 1024, MB 1,000,000, M 1,048,576,
GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.
If a FILE is '-' or missing, read standard input.
Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
This utility is part of the uutils project: https://github.com/uutils/
Report bugs here: https://github.com/uutils/diffutils/issues
"},
params.executable.to_string_lossy()
);
Option 2 is slightly more work, but dodges any concerns related to using stuff directly from GNU cmp, and something we would probably want if we ever move to something like Clap, I suppose.
Thoughts? Concerns?
- Ngôn ngữ chính
- Rust
- Star
- 276
- Fork
- 39
- Merge trung bình
- 3 giờ 27 phút
- Pull request đã merge (30 ngày)
- 3
Hướng dẫn đóng góp
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 uutils/diffutils
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 64/100
Tất cả issue của uutils/diffutils
Issue tương tự
-
risk:low runtime status:in-progress type:test
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
EricSpencer00/Resilient#4835 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
bisq-network/bisq-musig#204 ·
-
agent:ready documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
cesarferreira/stax#890 ·