<commit_before>#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#include <stdexcept>

#include <map>
#include <vector>
#include <string>
#include <fstream>
#include <iostream>
#include <istream>
#include <ostream>
#include <sstream>

#define CLIOPTS_ENABLE_CXX
#define INCLUDE_SUBDOC_NTOHLL
#include "subdoc/subdoc-api.h"
#include "subdoc/subdoc-util.h"
#include "subdoc/path.h"
#include "subdoc/match.h"
#include "subdoc/operations.h"
#include "contrib/cliopts/cliopts.h"

using std::string;
using std::vector;
using std::map;
using namespace cliopts;

struct OpEntry {
    uint8_t opcode;
    const char *description;
    OpEntry(uint8_t opcode = 0, const char *description = NULL) :
        opcode(opcode),
        description(description) {}

    operator uint8_t() const { return opcode; }
};

class Options {
public:
    Options() :
        o_iter('i', "iterations", 1000),
        o_path('p', "docpath"),
        o_value('v', "value"),
        o_jsfile('f', "json"),
        o_cmd('c', "command"),
        o_mkdirp('M', "--create-intermediate"),
        parser("subdoc-bench")
    {
        o_iter.description("Number of iterations to run");
        o_path.description("Document path to manipulate");
        o_value.description("Document value to insert");
        o_jsfile.description("JSON files to operate on. If passing multiple files, each file should be delimited by a comma");
        o_cmd.description("Command to use. Use -c help to show all the commands").mandatory();
        o_mkdirp.description("Create intermediate paths for mutation operations");

        parser.addOption(o_iter);
        parser.addOption(o_path);
        parser.addOption(o_value);
        parser.addOption(o_jsfile);
        parser.addOption(o_cmd);
        parser.addOption(o_mkdirp);

        totalBytes = 0;<commit_msg>Fix extra '--' in '--create-intermediate'<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#include <stdexcept>

#include <map>
#include <vector>
#include <string>
#include <fstream>
#include <iostream>
#include <istream>
#include <ostream>
#include <sstream>

#define CLIOPTS_ENABLE_CXX
#define INCLUDE_SUBDOC_NTOHLL
#include "subdoc/subdoc-api.h"
#include "subdoc/subdoc-util.h"
#include "subdoc/path.h"
#include "subdoc/match.h"
#include "subdoc/operations.h"
#include "contrib/cliopts/cliopts.h"

using std::string;
using std::vector;
using std::map;
using namespace cliopts;

struct OpEntry {
    uint8_t opcode;
    const char *description;
    OpEntry(uint8_t opcode = 0, const char *description = NULL) :
        opcode(opcode),
        description(description) {}

    operator uint8_t() const { return opcode; }
};

class Options {
public:
    Options() :
        o_iter('i', "iterations", 1000),
        o_path('p', "docpath"),
        o_value('v', "value"),
        o_jsfile('f', "json"),
        o_cmd('c', "command"),
        o_mkdirp('M', "create-intermediate"),
        parser("subdoc-bench")
    {
        o_iter.description("Number of iterations to run");
        o_path.description("Document path to manipulate");
        o_value.description("Document value to insert");
        o_jsfile.description("JSON files to operate on. If passing multiple files, each file should be delimited by a comma");
        o_cmd.description("Command to use. Use -c help to show all the commands").mandatory();
        o_mkdirp.description("Create intermediate paths for mutation operations");

        parser.addOption(o_iter);
        parser.addOption(o_path);
        parser.addOption(o_value);
        parser.addOption(o_jsfile);
        parser.addOption(o_cmd);
        parser.addOption(o_mkdirp);

        totalBytes = 0;
{'fraction_non_alphanumeric': 0.13679493937796522, 'fraction_numerical': 0.004744333157617291, 'mean_word_length': 3.5944309927360774, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7597538', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1221, 'n_words': 300}