<commit_before>#include "console.h"
#include <iostream>
#include <string>
#include <vector>

void doIt()
{
    std::cout << "I did it." << std::endl;
}

void sayTheName(std::string name)
{
    std::cout << "The name is: " << name << std::endl;
}

/*
void giveMeTheNumber(int number)
{
    std::cout << "The number is: " << number << std::endl;
}
*/

/*
void serveTheDrinks(int bottles, std::string beverage)
{
    std::cout << "here are " << bottles << " bottles " of " << beverage << std::endl;
}
*/


int main()
{
    Console console;
    console.registerCommand(
        "doIt", // command
        "do something", // description
        {}, // argument names
        {}, // argument default values
        (std::function<void(void)>) ([]() {doIt();}) // callback
    );

    console.registerCommand(
        "say", // command
        "says the name", // description
        {"name"}, // argument names
        {"arturo"}, // argument default values
        (std::function<void(std::string)>) ([](std::string name) {sayTheName(name);}) // callback
    );

    console.registerAlias("hey", "say"); // TODO: finish the alias implementation

    std::cout << console.processInput("doIt");
    std::cout << console.processInput("say arthur");
    std::cout << console.processInput("say");
    std::cout << console.processInput("hey dent");
    // std::cout << console.processInput("! dent");
    std::cout << console.processInput("help");
    std::cout << console.processInput("help say");
    std::cout << console.processInput("help commands");
    // console.listOfCommands("filter"); // returns a vector of Console::CommandDescription?
}
<commit_msg>add a second alias with a bang<commit_after>#include "console.h"
#include <iostream>
#include <string>
#include <vector>

void doIt()
{
    std::cout << "I did it." << std::endl;
}

void sayTheName(std::string name)
{
    std::cout << "The name is: " << name << std::endl;
}

/*
void giveMeTheNumber(int number)
{
    std::cout << "The number is: " << number << std::endl;
}
*/

/*
void serveTheDrinks(int bottles, std::string beverage)
{
    std::cout << "here are " << bottles << " bottles " of " << beverage << std::endl;
}
*/


int main()
{
    Console console;
    console.registerCommand(
        "doIt", // command
        "do something", // description
        {}, // argument names
        {}, // argument default values
        (std::function<void(void)>) ([]() {doIt();}) // callback
    );

    console.registerCommand(
        "say", // command
        "says the name", // description
        {"name"}, // argument names
        {"arturo"}, // argument default values
        (std::function<void(std::string)>) ([](std::string name) {sayTheName(name);}) // callback
    );

    console.registerAlias("hey", "say"); // TODO: finish the alias implementation
    console.registerAlias("!", "say"); // TODO: finish the alias implementation

    std::cout << console.processInput("doIt");
    std::cout << console.processInput("say arthur");
    std::cout << console.processInput("say");
    std::cout << console.processInput("hey dent");
    std::cout << console.processInput("! dent");
    std::cout << console.processInput("help");
    std::cout << console.processInput("help say");
    std::cout << console.processInput("help commands");
    // console.listOfCommands("filter"); // returns a vector of Console::CommandDescription?
}

{'fraction_non_alphanumeric': 0.18934040047114253, 'fraction_numerical': 0.0, 'mean_word_length': 3.2729559748427675, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 13, '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': '4238448', 'n_tokens_mistral': 1016, 'n_tokens_neox': 998, 'n_words': 247}