Repository navigation
fix(cli): make every help string match what the CLI does (#1796) - #1810
Conversation
|
Verdict: GOOD TO GO at |
|
The rendered-docs proofread (#1103) found more help strings with the same defect: |
The CLI help described behaviour the code does not have. -o read "The
name of input pcap file"; the input, -o and -a help said extensions are
always appended, but -a is off by default; -j, -p and -t each claimed to
override all other options, while main() tests -f, then -j, then -p,
then -t; -f claimed every dictdumper format, but the formats are those
Extractor registers, PCAP included. The rest were vague or ungrammatical
("a extraction", "if ... omits", "Indicate if store buffer", `stdin').
- pcapkit/__main__.py: every help string states the real behaviour,
including the format precedence and default, the engine fallback, where
-P/-L stop and that third-party engines ignore them, and when -B/-O
write a buffer file. No behaviour change.
- docs/source/pcapkit/index.rst: the CLI block regenerated from
`python -m pcapkit --help` at COLUMNS=80.
- tests/cli/test_main.py: pin each corrected help, checking the named
precedence against what main() forwards; every new assertion fails on
origin/main.
Closes #1796
d3f1f5c to
44a7738
Compare
|
Verdict: GOOD TO GO at |
|
Coverage: 89.60% (unit tier, Python 3.15,
Per-file detail: the |
Please follow the guide below
You will be asked some questions, please read them carefully and answer honestly
Put an
xinto all the boxes [ ] relevant to your pull request (like that [x])Use Preview tab to see how your pull request will actually look like
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the change. Narrow runs only, listed below.Added a changelog entry under
docs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible: N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseSummary
pcapkit-cli's help strings inpcapkit/__main__.pydid not matchmain()andExtractor. Each string was rewritten from probes of the real CLI; behaviour is untouched (an AST comparison with everyhelp=masked is identical).-odescribed the input file; it now gives the defaultout, the extension added only with--auto-extension, and the directory meaning under--files.-a: the input help said.pcapis appended; that happens only with--auto-extension, and not for.pcap,.capor.pcapngnames.-acovers the input too.-j,-pand-teach claimed to override all other options. The real order is-f, then-j, then-p, then-t, which is the default; each string now names what beats it.-flists the accepted formats.-v,-F,-E,-P/-L,-Band-Onow say what they do, and the grammar slips are fixed.docs/source/pcapkit/index.rstis regenerated from real--helpatCOLUMNS=80.tests/cli/test_main.pypins each corrected claim, including the precedence againstmain(). The new assertions fail onmain's strings.tests/cli, the CLI subprocess tests andtests/projectpass.Closes #1796