<commit_before>/**
 * Option and Argument Management
 *
 * Options are configuration settings sprinkled throughout the code. They can be grouped into sets of
 * options called |OptionSets| which can form a hierarchy of options. For instance:
 *
 * var set = new OptionSet();
 * var opt = set.register(new Option("v", "verbose", "boolean", false, "Enables verbose logging."));
 *
 * creates an option set with one option in it. The option can be changed directly using |opt.value = true| or
 * automatically using the |ArgumentParser|:
 *
 * var parser = new ArgumentParser();
 * parser.addBoundOptionSet(set);
 * parser.parse(["-v"]);
 *
 * The |ArgumentParser| can also be used directly:
 *
 * var parser = new ArgumentParser();
 * argumentParser.addArgument("h", "help", "boolean", {parse: function (x) {
 *   printUsage();
 * }});
 */

(function (exports) {
  var ArgumentParser = (function () {
    var Argument = (function () {
      function argument(shortName, longName, type, options) {
        this.shortName = shortName;
        this.longName = longName;
        this.type = type;
        options = options || {};
        this.positional = options.positional;
        this.parseFn = options.parse;
        this.value = options.defaultValue;
      }
      argument.prototype.parse = function parse(value) {
        if (this.type === "boolean") {
          release || assert(typeof value === "boolean");
          this.value = value;
        } else  if (this.type === "number") {
          release || assert(!isNaN(value), value + " is not a number");
          this.value = parseInt(value, 10);
        } else {
          this.value = value;
        }
        if (this.parseFn) {
          this.parseFn(value);
        }
      };
      return argument;
    })();
    function argumentParser() {
      this.arguments = [];
    }
    argumentParser.prototype.addArgument = function addArgument(shortName, longName, type, options) {
      var argument = new Argument(shortName, longName, type, options);
      this.arguments.push(argument);<commit_msg>Fixed bug in option parsing.<commit_after>/**
 * Option and Argument Management
 *
 * Options are configuration settings sprinkled throughout the code. They can be grouped into sets of
 * options called |OptionSets| which can form a hierarchy of options. For instance:
 *
 * var set = new OptionSet();
 * var opt = set.register(new Option("v", "verbose", "boolean", false, "Enables verbose logging."));
 *
 * creates an option set with one option in it. The option can be changed directly using |opt.value = true| or
 * automatically using the |ArgumentParser|:
 *
 * var parser = new ArgumentParser();
 * parser.addBoundOptionSet(set);
 * parser.parse(["-v"]);
 *
 * The |ArgumentParser| can also be used directly:
 *
 * var parser = new ArgumentParser();
 * argumentParser.addArgument("h", "help", "boolean", {parse: function (x) {
 *   printUsage();
 * }});
 */

(function (exports) {
  var ArgumentParser = (function () {
    var Argument = (function () {
      function argument(shortName, longName, type, options) {
        this.shortName = shortName;
        this.longName = longName;
        this.type = type;
        options = options || {};
        this.positional = options.positional;
        this.parseFn = options.parse;
        this.value = options.defaultValue;
      }
      argument.prototype.parse = function parse(value) {
        if (this.type === "boolean") {
          release || assert(typeof value === "boolean");
          this.value = value;
        } else  if (this.type === "number") {
          release || assert(!isNaN(value), value + " is not a number");
          this.value = parseInt(value, 10);
        } else {
          this.value = value;
        }
        if (this.parseFn) {
          this.parseFn(this.value);
        }
      };
      return argument;
    })();
    function argumentParser() {
      this.arguments = [];
    }
    argumentParser.prototype.addArgument = function addArgument(shortName, longName, type, options) {
      var argument = new Argument(shortName, longName, type, options);
      this.arguments.push(argument);
{'fraction_non_alphanumeric': 0.13104448742746616, 'fraction_numerical': 0.0009671179883945841, 'mean_word_length': 2.798898071625344, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2442776', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1118, 'n_words': 345}