def verify_args(parser, args, needed_args=None):
    """Verify that we have all positional arguments we need, if not, exit."""
    if needed_args:
        needed_list = needed_args.split(' ')
    else:
        needed_list = []
    len_need = len(needed_list)
    len_have = len(args)
    if len_have > len_need:
        parser.error('too many arguments')
    elif len_have < len_need:
        parser.error('no %s specified' % needed_list[len_have])
