summaryrefslogtreecommitdiff
path: root/sphinx/cmdline.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-02-17 19:19:09 +0100
committerGeorg Brandl <georg@python.org>2009-02-17 19:19:09 +0100
commit9cb11f9ae00b09e83105afb390ca1053c84ee84f (patch)
tree315f2b91aaa85c32a231975c50be3c023e7c1070 /sphinx/cmdline.py
parent3e808fe07b9167b5a40f56b61ea3ce016f8a6b1b (diff)
downloadsphinx-9cb11f9ae00b09e83105afb390ca1053c84ee84f.tar.gz
There is now a ``-W`` option for sphinx-build that turns warnings into errors.
^
Diffstat (limited to 'sphinx/cmdline.py')
-rw-r--r--sphinx/cmdline.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/sphinx/cmdline.py b/sphinx/cmdline.py
index 4642b795..b4c3cc7b 100644
--- a/sphinx/cmdline.py
+++ b/sphinx/cmdline.py
@@ -44,6 +44,7 @@ new and changed files
-N -- do not do colored output
-q -- no output on stdout, just warnings on stderr
-Q -- no output at all, not even warnings
+ -W -- turn warnings into errors
-P -- run Pdb on exception
Modi:
* without -a and without filenames, write new and changed files.
@@ -57,7 +58,7 @@ def main(argv):
nocolor()
try:
- opts, args = getopt.getopt(argv[1:], 'ab:d:c:CD:A:NEqQP')
+ opts, args = getopt.getopt(argv[1:], 'ab:d:c:CD:A:NEqQWP')
allopts = set(opt[0] for opt in opts)
srcdir = confdir = path.abspath(args[0])
if not path.isdir(srcdir):
@@ -86,7 +87,7 @@ def main(argv):
return 1
buildername = all_files = None
- freshenv = use_pdb = False
+ freshenv = warningiserror = use_pdb = False
status = sys.stdout
warning = sys.stderr
confoverrides = {}
@@ -143,13 +144,15 @@ def main(argv):
elif opt == '-Q':
status = None
warning = None
+ elif opt == '-W':
+ warningiserror = True
elif opt == '-P':
use_pdb = True
confoverrides['html_context'] = htmlcontext
try:
app = Sphinx(srcdir, confdir, outdir, doctreedir, buildername,
- confoverrides, status, warning, freshenv)
+ confoverrides, status, warning, freshenv, warningiserror)
app.build(all_files, filenames)
return app.statuscode
except KeyboardInterrupt: