comparison piecrust/chefutil.py @ 99:8703be118430

Changes to `help` command and extendable commands: - The `help` command has a prettier output, with descriptions of help topics. - `ExtendableChefCommand` is not assuming extensions are sub-commands anymore.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 13 Sep 2014 14:47:01 -0700
parents 2f717f961996
children 133845647083
comparison
equal deleted inserted replaced
98:5959a117a943 99:8703be118430
15 while ex: 15 while ex:
16 logger.error('%s%s' % (indent, str(ex))) 16 logger.error('%s%s' % (indent, str(ex)))
17 indent += ' ' 17 indent += ' '
18 ex = ex.__cause__ 18 ex = ex.__cause__
19 19
20
21 def print_help_item(s, title, description, margin=4, align=25):
22 s.write(margin * ' ')
23 s.write(title)
24 spacer = (align - margin - len(title) - 1)
25 if spacer <= 0:
26 s.write("\n")
27 s.write(' ' * align)
28 else:
29 s.write(' ' * spacer)
30 s.write(description)
31 s.write("\n")
32