if len(fields) != 5:
    raise argparse.ArgumentTypeError('String must have 5 fields')
elif not 1 <= int(fields[2]) <= 10:
    raise argparse.ArgumentTypeError(
        'Field 3 must be between 1 and 10, inclusive')
else:
    pass
argparse choices structure of allowed values