<commit_before>#include <cli/CommandLine.h>

#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>

extern "C" char *xmalloc (size_t size);

namespace cli
{
	namespace
	{
		char * dupstr (const char * s)
		{
			char *r = xmalloc (strlen (s) + 1);
			strcpy (r, s);
			return r;
		}
	}

	CommandLine::CommandLine()
	{
		rl_readline_name = "AFT";
		rl_attempted_completion_function = &CommandLine::CompletionCallback;
	}

	CommandLine & CommandLine::Get()
	{
		static CommandLine cmd;
		return cmd;
	}

	char * CommandLine::CompletionGenerator(const char *text, int state)
	{
		return state == 0? dupstr("dummy"): NULL;
	}

	char ** CommandLine::CompletionCallback(const char *text, int start, int end)
	{<commit_msg>removed xmalloc ref<commit_after>#include <cli/CommandLine.h>

#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>

namespace cli
{
	namespace
	{
		char * dupstr (const char * s)
		{
			char *r = strdup(s);
			if (!r)
				std::terminate();
			return r;
		}
	}

	CommandLine::CommandLine()
	{
		rl_readline_name = "AFT";
		rl_attempted_completion_function = &CommandLine::CompletionCallback;
	}

	CommandLine & CommandLine::Get()
	{
		static CommandLine cmd;
		return cmd;
	}

	char * CommandLine::CompletionGenerator(const char *text, int state)
	{
		return state == 0? dupstr("dummy"): NULL;
	}

	char ** CommandLine::CompletionCallback(const char *text, int start, int end)
	{
{'fraction_non_alphanumeric': 0.1375259156876296, 'fraction_numerical': 0.002073255010366275, 'mean_word_length': 4.323529411764706, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '308173', 'n_tokens_mistral': 566, 'n_tokens_neox': 520, 'n_words': 121}