OptionParser是否与Sphinx冲突?
发布于 2021-01-29 18:33:29
我试图在sphinx中为我的项目编写文档,并且只要sphinx在我的模块中遇到OptionParser,它就会给我:
sphinx-build: error: no such option: -b
我以为这是不可能的,所以我写了一个简单的模块检查一下:
from optparse import OptionParser
"""some comment here"""
parser = OptionParser(conflict_handler='resolve')
parser.add_option('', '--force', action='store_true', dest='force', default=False, help='gqdel will skip asking questions, and delete them all.');
parser.add_option('', '--verbose', action='store_true', dest='verbose', default=False, help='Report additional information from gqdel')
(options, args) = parser.parse_args()
"""and here"""
print "foo"
它给了我同样的错误。我的第一个样子是这样的:
some title
==========
.. automodule:: test
:members:
关注者
0
被浏览
52