Parses options.

def parse_options():
    """Parses options."""
    parser = argparse.ArgumentParser()
    parser.add_argument('command', help='The YCSB command.')
    parser.add_argument('benchmark', help='The YCSB benchmark.')
    parser.add_argument('-P', '--workload', action='store', dest='workload',
                        default='', help='The path to a YCSB workload file.')
    parser.add_argument('-p', '--parameter', action='append', dest='parameters',
                        default=[], help='The key=value pair of parameter.')
    parser.add_argument('-b', '--num_bucket', action='store', type=int,
                        dest='num_bucket', default=1000,
                        help='The number of buckets in output.')

    args = parser.parse_args()

    parameters = {}
    parameters['command'] = args.command
    parameters['num_bucket'] = args.num_bucket

    for parameter in args.parameters:
        parts = parameter.strip().split('=')
        parameters[parts[0]] = parts[1]

    with open(args.workload, 'r') as f:
        for line in f.readlines():
            parts = line.split('=')
            key = parts[0].strip()
            if key in OPERATIONS:
                parameters[key] = parts[1].strip()

    return parameters