diff --git a/doc/make.py b/doc/make.py index 2819a62347627..53635498f2adb 100755 --- a/doc/make.py +++ b/doc/make.py @@ -78,9 +78,11 @@ class DocBuilder: All public methods of this class can be called as parameters of the script. """ - def __init__(self, num_jobs=1, include_api=True, single_doc=None): + def __init__(self, num_jobs=1, include_api=True, single_doc=None, + verbosity=0): self.num_jobs = num_jobs self.include_api = include_api + self.verbosity = verbosity self.single_doc = None self.single_doc_type = None if single_doc is not None: @@ -120,7 +122,7 @@ def _process_single_doc(self, single_doc): """ self.include_api = False - if single_doc == 'api.rst': + if single_doc == 'api.rst' or single_doc == 'api': self.single_doc_type = 'api' self.single_doc = 'api' elif os.path.exists(os.path.join(SOURCE_PATH, single_doc)): @@ -229,6 +231,8 @@ def _sphinx_build(self, kind): self._run_os('sphinx-build', '-j{}'.format(self.num_jobs), '-b{}'.format(kind), + '-{}'.format( + 'v' * self.verbosity) if self.verbosity else '', '-d{}'.format(os.path.join(BUILD_PATH, 'doctrees')), '-Dexclude_patterns={}'.format(self.exclude_patterns), SOURCE_PATH, @@ -330,6 +334,9 @@ def main(): type=str, default=os.path.join(DOC_PATH, '..'), help='path') + argparser.add_argument('-v', action='count', dest='verbosity', default=0, + help=('increase verbosity (can be repeated), ' + 'passed to the sphinx build command')) args = argparser.parse_args() if args.command not in cmds: @@ -338,9 +345,9 @@ def main(): os.environ['PYTHONPATH'] = args.python_path - getattr(DocBuilder(args.num_jobs, - not args.no_api, - args.single), args.command)() + builder = DocBuilder(args.num_jobs, not args.no_api, args.single, + args.verbosity) + getattr(builder, args.command)() if __name__ == '__main__':