Parses arguments, returns (options, args).

def parse_args(args=None):
    """Parses arguments, returns (options, args)."""
    from argparse import ArgumentParser

    if args is None:
        args = sys.argv[1:]

    parser = ArgumentParser(description='Demonstrate drawing SVG on Clutter '
                            'stage')
    parser.add_argument('svg_path')
    parser.add_argument('shape', nargs='?', default=None)

    args = parser.parse_args(args)
    return args