[options] Refactor autonumber options and add validation (closes #727, closes #2702, closes #9362)

This commit is contained in:
Sergey M․ 2017-01-28 23:57:56 +07:00
parent acbb2374bc
commit 1a241a2d02
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D
2 changed files with 10 additions and 4 deletions

View file

@ -133,6 +133,12 @@ def _real_main(argv=None):
parser.error('TV Provider account username missing\n')
if opts.outtmpl is not None and (opts.usetitle or opts.autonumber or opts.useid):
parser.error('using output template conflicts with using title, video ID or auto number')
if opts.autonumber_size is not None:
if opts.autonumber_size <= 0:
parser.error('auto number size must be positive')
if opts.autonumber_start is not None:
if opts.autonumber_start < 0:
parser.error('auto number start must be positive or 0')
if opts.usetitle and opts.useid:
parser.error('using title conflicts with using video ID')
if opts.username is not None and opts.password is None: