def _build_usage(self, command):
rst_doc = gen_rst_doc(command)
man_doc = publish_string(rst_doc, writer=manpage.Writer())
cmdline = ['groff', '-m', 'man', '-T', 'ascii']
p = Popen(cmdline, stdin=PIPE, stdout=PIPE, stderr=PIPE)
usage = p.communicate(input=man_doc)[0]
return usage
评论列表
文章目录