def parse(parser=None, args=None):
    if not parser:
        parser = make_parser()
    try:
        parsed_args = parser.parse_args(args)
    except SystemExit as err:
        raise CommandLineExit(err.code)
    try:
        columns = parsed_args.columns
    except AttributeError:
        columns = collections.OrderedDict()
        parsed_args.columns = columns
    for title, spec in columns.items():
        if "pattern" not in spec:
            raise ColumnWithoutPatternError(
                'Column "{0}" needs a pattern'.format(title))
        if len(spec["pattern"]) == 1:
            spec["pattern"] = spec["pattern"][0]
    if columns and parsed_args.columns_file:
        raise ColumnsAndColumnsFileError(
            "You can't use the --column and --columns options together (yet)")
    elif parsed_args.columns_file and not columns:
        parsed_args.columns = parsed_args.columns_file
    elif (not columns) and (not parsed_args.columns_file):
        raise NoColumnsError(
            "You must give either a --columns or at least one -c/--column "
            "argument")
    else:
        assert columns
    return parsed_args