+ elif tmpl == 'int:pos':
+ if not arg.isdigit() or int(arg) < 1:
+ raise ArgError('Argument must be positive integer.')
+ args += [int(arg)]
+ elif tmpl == 'int':
+ try:
+ args += [int(arg)]
+ except ValueError:
+ raise ArgError('Argument must be integer.')
+ elif tmpl == 'bool':
+ if not arg.isdigit() or int(arg) not in (0, 1):
+ raise ArgError('Argument must be 0 or 1.')
+ args += [bool(int(arg))]
+ elif tmpl == 'char':
+ try:
+ ord(arg)
+ except TypeError:
+ raise ArgError('Argument must be single character.')
+ args += [arg]