def run_with_args(args, parser):
    set_logging_parameters(args)

    dprint(DEBUG_OPTIONS, args)

    num_actions = 0
    actions = 'convert lint gid gidsplit giddump'.split()
    for act in actions:
        if getattr(args, act):
            num_actions += 1

    if num_actions != 1:
        parser.error('Please specify exactly one of the options %s.' % ', '.join('--' + x for x in actions))

    ret = 0
    if args.gid is not None:
        ret = print_gids(args.gid, username=args.gid_user, pid=args.gid_pid, refdate=args.gid_date)
    elif args.gidsplit:
        ret = gidsplit(args.gidsplit, format=args.gid_format)
    elif args.giddump:
        ret = giddump(args, parser)
    elif args.lint:
        ret = lint(args, parser)
    elif args.convert:
        ret = convert(args, parser)
    else:
        parser.error('Something is wrong with the options or the handling of them.')

    return ret
dataset/ETHPy150Open mikr/xcodeprojer/xcodeprojer.py/run_with_args/original