Skip to content
Snippets Groups Projects
Commit 81fbd4e6 authored by Takumi IINO's avatar Takumi IINO
Browse files

gendoc: dispatch print document content by commandline arguments

Before this patch, gendoc.py only prints hg.1.gendoc.txt content.
This adds any content print function.
parent 762e51ce
Branches
Tags
No related merge requests found
......@@ -22,7 +22,7 @@
touch hg.1.txt
hg.1.gendoc.txt: $(GENDOC)
${PYTHON} gendoc.py > $@.tmp
${PYTHON} gendoc.py hg.1.gendoc > $@.tmp
mv $@.tmp $@
hgrc.5: ../mercurial/help/config.txt
......
"""usage: %s DOC ...
where DOC is the name of a document
"""
import os, sys, textwrap
# import from the live mercurial repo
sys.path.insert(0, "..")
......@@ -168,4 +173,11 @@
return extensions.enabled().keys() + extensions.disabled().keys()
if __name__ == "__main__":
showdoc(sys.stdout)
doc = 'hg.1.gendoc'
if len(sys.argv) > 1:
doc = sys.argv[1]
if doc == 'hg.1.gendoc':
showdoc(sys.stdout)
else:
showtopic(sys.stdout, sys.argv[1])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment