<commit_before>// Copyright (c) 2015 <NAME>. All rights reserved.
// Use of this source code is governed by the BSD license that can be
// found in the LICENSE file.

#include "base/at_exit.h"
#include "base/command_line.h"
#include "common/main_runner.h"

int main(int argc, char* argv[]) {
  base::CommandLine::Init(argc, argv);
  base::AtExitManager exit_manager;
  scoped_ptr<common::MainRunner> main_runner(common::MainRunner::Create());
  main_runner->CreateThreads();
  CHECK(main_runner->PostCreateThreads()) << "PostCreateThreads return false";
  main_runner->Run();
  main_runner->Shutdown();

  return 0;
}<commit_msg>Restore command line option to change working directory.<commit_after>// Copyright (c) 2015 <NAME>. All rights reserved.
// Use of this source code is governed by the BSD license that can be
// found in the LICENSE file.

#include "base/at_exit.h"
#include "base/command_line.h"
#include "common/main_runner.h"

int main(int argc, char* argv[]) {
  base::CommandLine::Init(argc, argv);
  base::AtExitManager exit_manager;

  const base::CommandLine* command_line =
      base::CommandLine::ForCurrentProcess();
  static const char kWorkingDir[] = "working_dir";
  if (command_line->HasSwitch(kWorkingDir)) {
    std::string working_dir = command_line->GetSwitchValueASCII(kWorkingDir);
    if (!working_dir.empty()) {
      LOG(INFO) << "dn: Entering directory " << working_dir;
      int ret = chdir(working_dir.c_str());
      CHECK(ret == 0) << "chdir to " << working_dir << " -" << strerror(errno);
    }
  }

  scoped_ptr<common::MainRunner> main_runner(common::MainRunner::Create());
  main_runner->CreateThreads();
  CHECK(main_runner->PostCreateThreads()) << "PostCreateThreads return false";
  main_runner->Run();
  main_runner->Shutdown();

  return 0;
}
{'fraction_non_alphanumeric': 0.14445064138315672, 'fraction_numerical': 0.006134969325153374, 'mean_word_length': 5.0, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 17, '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': '5340994', 'n_tokens_mistral': 580, 'n_tokens_neox': 562, 'n_words': 143}