9
0
Fork 0

Documentation: handle missing group declaration

Use group 'misc' as a default and print a warning.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
This commit is contained in:
Jan Luebbe 2015-03-10 14:46:21 +01:00 committed by Sascha Hauer
parent 03b59bdb64
commit a1a5a21298
1 changed files with 5 additions and 1 deletions

View File

@ -161,7 +161,11 @@ for name in CMDS.keys():
for name, cmd in CMDS.items():
#pprint({name: cmd})
rst = gen_rst(name, cmd)
subdir = os.path.join(sys.argv[2], cmd['c_group'][0])
group = cmd.get('c_group')
if group is None:
print >> sys.stderr, "gen_commands: warning: using default group 'misc' for command '%s'" % name
group = ['misc']
subdir = os.path.join(sys.argv[2], group[0])
try:
os.makedirs(subdir)
except OSError as e: