How to approach --help implementation
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
首先檢視 pull request #88 中引用的 cmp 實作,並將其目前的命令列行為與此處顯示的 GNU cmp 說明輸出進行比較。釐清說明是否應遵循 GNU 的措辭,或應獨立撰寫,接著定義這項決定應如何套用至其他 diffutils 工具;issue 未指定要執行的檔案或測試。
由索引模型根據 Issue 內容生成。
描述
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?
- 主要語言
- Rust
- 星號
- 276
- 分支
- 44
- 平均合併
- 1 天 23 小時
- 30 天內合併 PR
- 8
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
uutils/diffutils 的其他 Issue
-
cmp: quiet mode compares full file sizes before applying -n可能已有人在做 @SichenLiang 於 7 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
diff: `-y --tabsize=<huge>` overflows the column arithmetic (overflow-checks only)可能已有人在做 @sami-daniel 於 58 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 1 天內回覆
-
diff panics on an oversized inline context count (`-c`/`-u`/`-C`/`-U`): parse overflow and capacity overflow可能已有人在做 @MsfPablo 於 54 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
uutils/diffutils#245 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
sdiff: fix the layout of unchanged rows, blank lines and cut tabs可能已有人在做 @sami-daniel 於 4 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 28/100
維護者通常 1 天內回覆
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
bug good first issue
難度 2/5 1-3 小時 新手友好度 84/100
repowise-dev/repowise#3374 ·
維護者通常 1 天內回覆
-
awaiting-response bug needs-triage
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 3 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
objectionary/sodg.rs#301 ·
-
難度 2/5 1-3 小時 新手友好度 62/100
HakanSeven12/OpenCADStudio#1706 · 1 則留言 ·
維護者通常 1 天內回覆