<commit_before>#include "vast/program.h"

#include <cstdlib>
#include <iostream>
#include "vast/archive.h"
#include "vast/exception.h"
#include "vast/id_tracker.h"
#include "vast/index.h"
#include "vast/ingestor.h"
#include "vast/logger.h"
#include "vast/query_client.h"
#include "vast/search.h"
#include "vast/system_monitor.h"
#include "vast/comm/broccoli.h"
#include "vast/detail/cppa_type_info.h"
#include "vast/fs/path.h"
#include "vast/fs/operations.h"
#include "vast/meta/schema_manager.h"
#include "vast/util/profiler.h"
#include "config.h"

namespace vast {

using namespace cppa;

program::program(configuration const& config)
  : config_(config)
{
  detail::cppa_announce_types();
}

bool program::run()
{
  if (! start())
    return false;

  auto mon = spawn<system_monitor>(self);
  self->monitor(mon);
  bool done = false;
  do_receive(
      on(atom("system"), atom("keystroke"), arg_match) >> [=](char key)
      {
        if (! query_client_)
          return;

        switch (key)
        {
          default:
            LOG(info, core) << "invalid key: '" << key << "'";
          case '?':
            LOG(info, core)
              << "available commands: "
                 "'(s)tatistics', <space> for results, (Q)uit";
            break;
          case ' ':
            send(query_client_, atom("client"), atom("results"));
            break;
          case 's':
            send(query_client_, atom("client"), atom("statistics"));
            break;
        }
      },
      on(atom("DOWN"), arg_match) >> [&done](uint32_t reason)
      {
        done = true;<commit_msg>Slight cosmetic tweak.<commit_after>#include "vast/program.h"

#include <cstdlib>
#include <iostream>
#include "vast/archive.h"
#include "vast/exception.h"
#include "vast/id_tracker.h"
#include "vast/index.h"
#include "vast/ingestor.h"
#include "vast/logger.h"
#include "vast/query_client.h"
#include "vast/search.h"
#include "vast/system_monitor.h"
#include "vast/comm/broccoli.h"
#include "vast/detail/cppa_type_info.h"
#include "vast/fs/path.h"
#include "vast/fs/operations.h"
#include "vast/meta/schema_manager.h"
#include "vast/util/profiler.h"
#include "config.h"

namespace vast {

using namespace cppa;

program::program(configuration const& config)
  : config_(config)
{
  detail::cppa_announce_types();
}

bool program::run()
{
  if (! start())
    return false;

  auto mon = spawn<system_monitor>(self);
  self->monitor(mon);
  bool done = false;
  do_receive(
      on(atom("system"), atom("keystroke"), arg_match) >> [=](char key)
      {
        if (! query_client_)
          return;

        switch (key)
        {
          default:
            LOG(info, core) << "invalid key: '" << key << "'";
          case '?':
            LOG(info, core)
              << "available commands: "
                 "<space> for results, (s)tatistics, (Q)uit";
            break;
          case ' ':
            send(query_client_, atom("client"), atom("results"));
            break;
          case 's':
            send(query_client_, atom("client"), atom("statistics"));
            break;
        }
      },
      on(atom("DOWN"), arg_match) >> [&done](uint32_t reason)
      {
        done = true;
{'fraction_non_alphanumeric': 0.16578207930065564, 'fraction_numerical': 0.001248829222603809, 'mean_word_length': 2.6912442396313363, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 21, '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': '3351297', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1058, 'n_words': 213}