Skip to content

Commit b09cc1d

Browse files
mchehabJonathan Corbet
authored andcommitted
docs: sphinx-build-wrapper: allow -v override -q
Documentation builds were using "-q" for a long time, but sometimes it is nice to see the Sphinx progress, without increasing build verbosity - which would also turn on kernel-doc verbosity. Instead of doing that, let's parse the sphinx-build already-existing -v: each time it is used, it increases the verbosity level. With that, if the default is to use -q, a single -v will disable quiet mode. Passing more -v will keep increasing its verbosity. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <38b24e97a3cbd2def418359a8e69b1b087a945ad.1769500383.git.mchehab+huawei@kernel.org>
1 parent 98f51c4 commit b09cc1d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tools/docs/sphinx-build-wrapper

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ class SphinxBuilder:
168168
parser = argparse.ArgumentParser()
169169
parser.add_argument('-j', '--jobs', type=int)
170170
parser.add_argument('-q', '--quiet', action='store_true')
171+
parser.add_argument('-v', '--verbose', default=0, action='count')
171172

172173
#
173174
# Other sphinx-build arguments go as-is, so place them
@@ -179,10 +180,14 @@ class SphinxBuilder:
179180
# Build a list of sphinx args, honoring verbosity here if specified
180181
#
181182

182-
verbose = self.verbose
183183
sphinx_args, self.sphinxopts = parser.parse_known_args(sphinxopts)
184+
185+
verbose = sphinx_args.verbose
186+
if self.verbose:
187+
verbose += 1
188+
184189
if sphinx_args.quiet is True:
185-
verbose = False
190+
verbose = 0
186191

187192
#
188193
# If the user explicitly sets "-j" at command line, use it.
@@ -195,8 +200,11 @@ class SphinxBuilder:
195200
else:
196201
self.n_jobs = None
197202

198-
if not verbose:
203+
if verbose < 1:
199204
self.sphinxopts += ["-q"]
205+
else:
206+
for i in range(1, sphinx_args.verbose):
207+
self.sphinxopts += ["-v"]
200208

201209
def __init__(self, builddir, venv=None, verbose=False, n_jobs=None,
202210
interactive=None):

0 commit comments

Comments
 (0)