<commit_before>/*global Buffer, console, process, require*/
var
	// Parse command line args
	args = (function (argv) {
		var
			len = argv.length,
			arg2 = len > 2 && argv[2],
			arg3 = len > 3 && argv[3],
			arg4 = len > 4 && argv[4],
			slash = arg3 && (arg3.length - 1),
			args = {},
			hostPort
		;

		if (len < 4 ||
			(arg2 != 'serve' && arg2 != 'get' && arg2 != 'build') ||
			(arg2 == 'get' && len < 5) ||
			(arg2 == 'build' && len < 5))
		{
			console.log('Usage:');
			console.log('  gravity serve <dir> [[<host>]:[<port>]]');
			console.log('    or');
			console.log('  gravity get <dir> <path>');
			console.log('    or');
			console.log('  gravity build <dir> <outdir>');
			process.exit(1);
		}

		args.serve = arg2 == 'serve';
		args.get = arg2 == 'get';
		args.build = arg2 == 'build';
		args.dir = arg3.charAt(slash) == '/' ? arg3.substr(0, slash) : arg3;

		if (args.serve) {
			hostPort = (arg4 || ':').split(':');
			args.host = hostPort[0];
			args.port = hostPort[1];
		}

		if (args.get) {
			args.path = arg4;
		}
<commit_msg>gravity version 0.1.0<commit_after>/*global Buffer, console, process, require*/
var
	VERSION = '0.1.0',

	// Parse command line args
	args = (function (argv) {
		var
			len = argv.length,
			arg2 = len > 2 && argv[2],
			arg3 = len > 3 && argv[3],
			arg4 = len > 4 && argv[4],
			slash = arg3 && (arg3.length - 1),
			args = {},
			hostPort
		;

		if (arg2 == 'version' || arg2 == 'serve' || arg2 == 'build') {
			console.log('gravity version ' + VERSION);
			if (arg2 == 'version') {
				process.exit(0);
			}
		}
			
		if (len < 4 ||
			(arg2 != 'serve' && arg2 != 'get' && arg2 != 'build') ||
			(arg2 == 'get' && len < 5) ||
			(arg2 == 'build' && len < 5))
		{
			console.log('Usage:');
			console.log('  gravity serve <dir> [[<host>]:[<port>]]');
			console.log('    or');
			console.log('  gravity get <dir> <path>');
			console.log('    or');
			console.log('  gravity build <dir> <outdir>');
			process.exit(1);
		}

		args.serve = arg2 == 'serve';
		args.get = arg2 == 'get';
		args.build = arg2 == 'build';
		args.dir = arg3.charAt(slash) == '/' ? arg3.substr(0, slash) : arg3;

		if (args.serve) {
			hostPort = (arg4 || ':').split(':');
			args.host = hostPort[0];
			args.port = hostPort[1];
		}

		if (args.get) {
			args.path = arg4;
		}

{'fraction_non_alphanumeric': 0.22746967071057192, 'fraction_numerical': 0.03249566724436742, 'mean_word_length': 2.647709320695103, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '5657200', 'n_tokens_mistral': 1054, 'n_tokens_neox': 902, 'n_words': 216}