<commit_before>"use strict";

var args = process.argv;
args.splice(0, 2);

exports.end = function(){
	if(args.length != 0) throw new Error("Unexpected argument `" + args[0] + "`.");
};

exports.values = function(){
	if(!args[0]) return {};
	var names = Array.prototype.slice.call(arguments);
	var arg, values = {};

	while(args[0] && args[0].indexOf("--") == 0){
		arg = args.shift().replace("--", "");

		if(arg.indexOf("=") != -1){
			var k = arg.split("=")[0];

			if(names.indexOf(k) == -1) throw new Error("Unexpected key `" + k + "`.");

			values[k] = arg.replace(k + "=", "").replace(/^"/, "").replace(/"$/, "");
		} else {
			if(names.indexOf(arg) == -1) throw new Error("Unexpected key `" + arg + "`.");
			values[arg] = args.shift();
		}
	}

	return values;
};

exports.options = function(){
	if(!args[0]) return {};
	var names = Array.prototype.slice.call(arguments);
	var arg, options = {};

	for(var name in names) if(name.hasOwnProperty(name)) {
		options[names[name]] = false;
	}

	while(args[0] && args[0].indexOf("-") == 0 && args[0].indexOf("--") != 0){
		arg = args.shift().replace("-", "");

		if(!names[arg]) throw new Error("Unexpected key `" + arg + "`.");

		options[names[arg]] = true;
	}

	return options;
};

exports.expect = function(){
	if(!args[0]) throw new Error("Expected argument.");
	var names = Array.prototype.slice.call(arguments);
	if(names.indexOf(args[0]) == -1) throw new Error("Unexpected argument `" + args[0] + "`.");
	return args.shift();
};

exports.read = function(){
	if(!args[0]) throw new Error("Expected word.");
	return args.shift();
};<commit_msg>options bug fix<commit_after>"use strict";

var args = process.argv;
args.splice(0, 2);

exports.end = function(){
	if(args.length != 0) throw new Error("Unexpected argument `" + args[0] + "`.");
};

exports.values = function(){
	if(!args[0]) return {};
	var names = Array.prototype.slice.call(arguments);
	var arg, values = {};

	while(args[0] && args[0].indexOf("--") == 0){
		arg = args.shift().replace("--", "");

		if(arg.indexOf("=") != -1){
			var k = arg.split("=")[0];

			if(names.indexOf(k) == -1) throw new Error("Unexpected key `" + k + "`.");

			values[k] = arg.replace(k + "=", "").replace(/^"/, "").replace(/"$/, "");
		} else {
			if(names.indexOf(arg) == -1) throw new Error("Unexpected key `" + arg + "`.");
			values[arg] = args.shift();
		}
	}

	return values;
};

exports.options = function(names){
	if(!args[0]) return {};
	var arg, options = {};

	for(var name in names) if(names.hasOwnProperty(name)) {
		options[names[name]] = false;
	}

	while(args[0] && args[0].indexOf("-") == 0 && args[0].indexOf("--") != 0){
		arg = args.shift().replace("-", "");

		if(!names[arg]) throw new Error("Unexpected key `" + arg + "`.");

		options[names[arg]] = true;
	}

	return options;
};

exports.expect = function(){
	if(!args[0]) throw new Error("Expected argument.");
	var names = Array.prototype.slice.call(arguments);
	if(names.indexOf(args[0]) == -1) throw new Error("Unexpected argument `" + args[0] + "`.");
	return args.shift();
};

exports.read = function(){
	if(!args[0]) throw new Error("Expected word.");
	return args.shift();
};
{'fraction_non_alphanumeric': 0.24715189873417723, 'fraction_numerical': 0.014556962025316455, 'mean_word_length': 4.02543720190779, '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': '2285622', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1101, 'n_words': 241}