How do I format positional argument help using Python's optparse?

后端 未结 4 1259
刺人心
刺人心 2021-02-02 09:57

As mentioned in the docs the optparse.OptionParser uses an IndentedHelpFormatter to output the formatted option help, for which which I found some API

4条回答
  •  不思量自难忘°
    2021-02-02 10:34

    Most help text for positional arguments resembles the format frequently used in man pages for *NIX boxes. Take a look at how the 'cp' command is documented. Your help text should resemble that.

    Otherwise as long as you fill out the "help" argument while using the parser, the documentation should produce itself.

提交回复
热议问题