python optparse, how to include additional info in usage output?

前端 未结 6 2105
野性不改
野性不改 2021-02-01 04:03

Using python\'s optparse module I would like to add extra example lines below the regular usage output. My current help_print() output looks like this:

usage: ch         


        
6条回答
  •  南笙
    南笙 (楼主)
    2021-02-01 04:58

    There is a description parameter you can pass to the OptionParser constructor. This allows you to include arbitrary text that appears after usage, but before the list of options.

    See 16.4.3.1. Creating the parser.

提交回复
热议问题