summaryrefslogtreecommitdiff
path: root/sphinx/cmdline.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-01-16 01:03:53 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-01-16 01:03:53 +0900
commitddcb45dad608c2d93c4a1da9fa17a0d27645e3ab (patch)
tree0c59aa06c285ac880e98c8fbc62fbfbc7b991f6b /sphinx/cmdline.py
parentcdb31585a834dc38658691ef51236952bd132aa4 (diff)
downloadsphinx-git-ddcb45dad608c2d93c4a1da9fa17a0d27645e3ab.tar.gz
Validate -j option is positive
Diffstat (limited to 'sphinx/cmdline.py')
-rw-r--r--sphinx/cmdline.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/sphinx/cmdline.py b/sphinx/cmdline.py
index 365238607..4cf5a07ef 100644
--- a/sphinx/cmdline.py
+++ b/sphinx/cmdline.py
@@ -94,7 +94,11 @@ def jobs_argument(value):
if value == 'auto':
return multiprocessing.cpu_count()
else:
- return int(value)
+ jobs = int(value)
+ if jobs <= 0:
+ raise argparse.ArgumentTypeError('job number should be a positive number')
+ else:
+ return jobs
def get_parser():