Skip to content

Commit c601189

Browse files
committed
Add --help output to command docs, and other reorganization
1 parent a97cf2c commit c601189

File tree

7 files changed

+152
-97
lines changed

7 files changed

+152
-97
lines changed

.gitignore

+6-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ covmain.zip
3535
zipmods.zip
3636

3737
# Stuff in the doc directory.
38-
_build
39-
_spell
40-
sample_html_beta
38+
doc/_build
39+
doc/_spell
40+
doc/sample_html_beta
41+
42+
# Build intermediaries.
43+
tmp
4144

4245
# Stuff in the ci directory.
4346
*.token

Makefile

+23-7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ clean: clean_platform ## Remove artifacts of test execution, i
2828
rm -rf tests/eggsrc/build tests/eggsrc/dist tests/eggsrc/*.egg-info
2929
rm -f setuptools-*.egg distribute-*.egg distribute-*.tar.gz
3030
rm -rf doc/_build doc/_spell doc/sample_html_beta
31+
rm -rf tmp
3132
rm -rf .cache .pytest_cache .hypothesis
3233
rm -rf $$TMPDIR/coverage_test
3334
-make -C tests/gold/html clean
@@ -133,10 +134,25 @@ WEBHOME = ~/web/stellated/
133134
WEBSAMPLE = $(WEBHOME)/files/sample_coverage_html
134135
WEBSAMPLEBETA = $(WEBHOME)/files/sample_coverage_html_beta
135136

136-
$(DOCPYTHON):
137+
$(DOCBIN):
137138
tox -q -e doc --notest
138139

139-
dochtml: $(DOCBIN) ## Build the docs HTML output.
140+
cmd_help: $(DOCBIN)
141+
mkdir -p tmp
142+
for cmd in annotate combine debug erase html json report run xml; do \
143+
echo > tmp/$$cmd.rst; \
144+
echo ".. code::" >> tmp/$$cmd.rst; \
145+
echo >> tmp/$$cmd.rst; \
146+
echo " $$ coverage $$cmd --help" >> tmp/$$cmd.rst; \
147+
$(DOCBIN)/python -m coverage $$cmd --help | \
148+
sed \
149+
-e 's/__main__.py/coverage/' \
150+
-e '/^Full doc/d' \
151+
-e 's/^/ /' \
152+
>> tmp/$$cmd.rst; \
153+
done
154+
155+
dochtml: $(DOCBIN) cmd_help ## Build the docs HTML output.
140156
$(DOCBIN)/python doc/check_copied_from.py doc/*.rst
141157
$(SPHINXBUILD) -b html doc doc/_build/html
142158

@@ -156,16 +172,16 @@ publishbeta:
156172
mkdir -p $(WEBSAMPLEBETA)
157173
cp doc/sample_html_beta/*.* $(WEBSAMPLEBETA)
158174

159-
CHANGES_MD = /tmp/rst_rst/changes.md
160-
RELNOTES_JSON = /tmp/relnotes.json
175+
CHANGES_MD = tmp/rst_rst/changes.md
176+
RELNOTES_JSON = tmp/relnotes.json
161177

162178
$(CHANGES_MD): CHANGES.rst $(DOCBIN)
163-
$(SPHINXBUILD) -b rst doc /tmp/rst_rst
164-
pandoc -frst -tmarkdown_strict --atx-headers --wrap=none /tmp/rst_rst/changes.rst > $(CHANGES_MD)
179+
$(SPHINXBUILD) -b rst doc tmp/rst_rst
180+
pandoc -frst -tmarkdown_strict --atx-headers --wrap=none tmp/rst_rst/changes.rst > $(CHANGES_MD)
165181

166182
relnotes_json: $(RELNOTES_JSON)
167183
$(RELNOTES_JSON): $(CHANGES_MD)
168-
$(DOCBIN)/python ci/parse_relnotes.py /tmp/rst_rst/changes.md $(RELNOTES_JSON)
184+
$(DOCBIN)/python ci/parse_relnotes.py tmp/rst_rst/changes.md $(RELNOTES_JSON)
169185

170186
tidelift_relnotes: $(RELNOTES_JSON) ## Upload parsed release notes to Tidelift.
171187
$(DOCBIN)/python ci/tidelift_relnotes.py $(RELNOTES_JSON) pypi/coverage

coverage/cmdline.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,11 @@ def get_prog_name(self):
351351
description=(
352352
"Display information on the internals of coverage.py, "
353353
"for diagnosing problems. "
354-
"Topics are 'data' to show a summary of the collected data, "
355-
"or 'sys' to show installation information."
354+
"Topics are: "
355+
"'data' to show a summary of the collected data; "
356+
"'sys' to show installation information; "
357+
"'config' to show the configuration; "
358+
"or 'premain' to show what is calling coverage."
356359
),
357360
),
358361

doc/_static/coverage.css

+1-5
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ img.tideliftlogo {
1515
margin-top: .5em !important;
1616
}
1717

18-
.rst-content div[class^="highlight"] {
19-
margin-bottom: 12px;
20-
}
21-
2218
.rst-content ol.arabic li {
2319
margin-bottom: 12px;
2420
}
@@ -46,11 +42,11 @@ img.tideliftlogo {
4642

4743
.rst-content pre.literal-block {
4844
white-space: pre;
49-
margin: 0 !important;
5045
padding: 12px 12px !important;
5146
font-family: Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;
5247
font-size: 12px;
5348
display: block;
5449
overflow: auto;
5550
color: #404040;
51+
background: #efc;
5652
}

0 commit comments

Comments
 (0)