Tôi đang cố gắng để viết một tài liệu cho dự án của tôi trong Sphinx và bất cứ khi nào nhân sư gặp OptionParser trong mô-đun của tôi nó mang lại cho tôi:Có phải OptionParser xung đột với nhân sư không?
sphinx-build: error: no such option: -b
Tôi nghĩ rằng đó là không thể, vì vậy tôi đã viết một module đơn giản để kiểm tra điều này:
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"
Và nó mang lại cho tôi cùng một lỗi. đầu tiên của tôi trông như thế này:
some title
==========
.. automodule:: test
:members:
+1; các 'parser.parse_args()' không có kinh doanh ở tất cả các mã cấp mô-đun, và không chỉ vì sphynx phàn nàn về nó. – SingleNegationElimination
vâng, đó là vấn đề của tôi, cảm ơn – Michal