Documentation: use command groups
The help definition already contained a group declaration. This is now reused for the HTML documentation. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
a6ab59d179
commit
c949b66674
|
@ -1,9 +1,91 @@
|
||||||
Command reference
|
Command reference
|
||||||
=================
|
=================
|
||||||
|
|
||||||
|
Information
|
||||||
|
-----------
|
||||||
.. toctree::
|
.. toctree::
|
||||||
|
:titlesonly:
|
||||||
:glob:
|
:glob:
|
||||||
:maxdepth: 1
|
|
||||||
|
|
||||||
commands/*
|
commands/info/*
|
||||||
|
|
||||||
|
Booting
|
||||||
|
-------
|
||||||
|
.. toctree::
|
||||||
|
:titlesonly:
|
||||||
|
:glob:
|
||||||
|
|
||||||
|
commands/boot/*
|
||||||
|
|
||||||
|
Partitions and Filesystems
|
||||||
|
--------------------------
|
||||||
|
.. toctree::
|
||||||
|
:titlesonly:
|
||||||
|
:glob:
|
||||||
|
|
||||||
|
commands/part/*
|
||||||
|
|
||||||
|
Environment
|
||||||
|
-----------
|
||||||
|
.. toctree::
|
||||||
|
:titlesonly:
|
||||||
|
:glob:
|
||||||
|
|
||||||
|
commands/env/*
|
||||||
|
|
||||||
|
Files
|
||||||
|
-----
|
||||||
|
.. toctree::
|
||||||
|
:titlesonly:
|
||||||
|
:glob:
|
||||||
|
|
||||||
|
commands/file/*
|
||||||
|
|
||||||
|
Shell Scripting
|
||||||
|
---------------
|
||||||
|
.. toctree::
|
||||||
|
:titlesonly:
|
||||||
|
:glob:
|
||||||
|
|
||||||
|
commands/script/*
|
||||||
|
|
||||||
|
Console and Framebuffer
|
||||||
|
-----------------------
|
||||||
|
.. toctree::
|
||||||
|
:titlesonly:
|
||||||
|
:glob:
|
||||||
|
|
||||||
|
commands/console/*
|
||||||
|
|
||||||
|
Memory
|
||||||
|
------
|
||||||
|
.. toctree::
|
||||||
|
:titlesonly:
|
||||||
|
:glob:
|
||||||
|
|
||||||
|
commands/mem/*
|
||||||
|
|
||||||
|
Hardware Manipulation
|
||||||
|
---------------------
|
||||||
|
.. toctree::
|
||||||
|
:titlesonly:
|
||||||
|
:glob:
|
||||||
|
|
||||||
|
commands/hwmanip/*
|
||||||
|
|
||||||
|
Miscelleanous
|
||||||
|
-------------
|
||||||
|
.. toctree::
|
||||||
|
:titlesonly:
|
||||||
|
:glob:
|
||||||
|
|
||||||
|
commands/misc/*
|
||||||
|
|
||||||
|
Networking
|
||||||
|
----------
|
||||||
|
.. toctree::
|
||||||
|
:titlesonly:
|
||||||
|
:glob:
|
||||||
|
|
||||||
|
commands/net/*
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import errno
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
@ -76,7 +77,7 @@ def parse_c(name):
|
||||||
x = CMD_GROUP.match(line)
|
x = CMD_GROUP.match(line)
|
||||||
if x:
|
if x:
|
||||||
last = cmd['c_group']
|
last = cmd['c_group']
|
||||||
last.append(x.group(1).decode("string_escape"))
|
last.append(x.group(1).split('_')[-1].lower())
|
||||||
continue
|
continue
|
||||||
x = CONT.match(line)
|
x = CONT.match(line)
|
||||||
if x:
|
if x:
|
||||||
|
@ -159,6 +160,14 @@ for name in CMDS.keys():
|
||||||
for name, cmd in CMDS.items():
|
for name, cmd in CMDS.items():
|
||||||
#pprint({name: cmd})
|
#pprint({name: cmd})
|
||||||
rst = gen_rst(name, cmd)
|
rst = gen_rst(name, cmd)
|
||||||
target = os.path.join(sys.argv[2], name+'.rst')
|
subdir = os.path.join(sys.argv[2], cmd['c_group'][0])
|
||||||
|
try:
|
||||||
|
os.makedirs(subdir)
|
||||||
|
except OSError as e:
|
||||||
|
if e.errno == errno.EEXIST and os.path.isdir(subdir):
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
target = os.path.join(subdir, name+'.rst')
|
||||||
file(target, 'w').write(rst)
|
file(target, 'w').write(rst)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue