How to approach --help implementation
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 25/100
Direção de pesquisa
Comece revisando a implementação de cmp referenciada no pull request #88 e compare seu comportamento atual na linha de comando com a saída de ajuda do GNU cmp mostrada aqui. Determine se a ajuda deve seguir a redação do GNU ou ser escrita de forma independente e, em seguida, defina como essa decisão deve ser aplicada às outras ferramentas do diffutils; o issue não nomeia arquivos nem testes a serem executados.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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?
- Linguagem predominante
- Rust
- Estrelas
- 276
- Forks
- 39
- Merge médio
- 4d 12h
- PRs com merge (30d)
- 3
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de uutils/diffutils
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
Todas as issues de uutils/diffutils
Issues semelhantes
-
bug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
yantrikos/yantrik-os#255 ·
-
Replayed reasoning items send "content": null, which the Responses API schema does not permit Abertabug CLI custom-model
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
raphamorim/rio#1956 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
rust-bitcoin/rust-bitcoin#6930 · 1 comentário ·