<commit_before>/*!
 * \file report.cxx
 * \brief Program entry and command line parsing for MP3Report.
 *
 * Copyright (c) 2013 <NAME> <<EMAIL>>
 *
 * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
 * or copy at http://opensource.org/licenses/MIT)
 */

#include <boost/program_options.hpp>
namespace po = boost::program_options;

#include <iostream>
#include <iterator>
#include <map>
using namespace std;

#include "report_config.hxx"
#include "reporter.hxx"

int main (int argc, char *argv[]) {

  string report_type, directory, output_path;

  po::options_description desc("Allowed options");
  desc.add_options()
    ("help,h", "Produce this help message")
    ("version,v", "Print version string")
    ("report-type,r", po::value<string>(&report_type)->default_value("plain"),
     "Report type (html_list, html_collapsible, csv, plain)")
    ("output-path,o", po::value<string>(&output_path),
     "File to write the report to (fallback: stdout)")
    ("directory", po::value<string>(&directory)->required(), "Working directory")
  ;

  po::positional_options_description p;
  p.add("directory", -1);

  po::variables_map vm;

  po::store(po::command_line_parser(argc, argv).options(desc).positional(p).run(), vm);

  if (vm.count("help")) {
    cout << desc << endl;
    return 0;
  }
  if (vm.count("version")) {
    cout << argv[0] << " version " << MP3REPORT_VERSION_MAJOR << "." << MP3REPORT_VERSION_MINOR << endl;
    return 0;
  }

  try {
    po::notify(vm);
  } catch ( const boost::program_options::error& e ) {
    cerr << e.what() << endl;
    return 1;
  }

  if (vm["report-type"].as<string>() != "html_list" && 
      vm["report-type"].as<string>() != "html_collapsible" &&
      vm["report-type"].as<string>() != "csv" &&
      vm["report-type"].as<string>() != "plain") {
    cerr << "invalid report type (should be one of html_list, html_collapsible, csv or plain)" << endl;
    return 1;
  }

  Reporter reporter(&directory, &report_type, &output_path);
  reporter.run();
  return 0;
}
<commit_msg>use camel case for members.<commit_after>/*!
 * \file report.cxx
 * \brief Program entry and command line parsing for MP3Report.
 *
 * Copyright (c) 2013 <NAME> <<EMAIL>>
 *
 * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
 * or copy at http://opensource.org/licenses/MIT)
 */

#include <boost/program_options.hpp>
namespace po = boost::program_options;

#include <iostream>
#include <iterator>
#include <map>
using namespace std;

#include "report_config.hxx"
#include "reporter.hxx"

int main (int argc, char *argv[]) {

  string reportType, directory, outputPath;

  po::options_description desc("Allowed options");
  desc.add_options()
    ("help,h", "Produce this help message")
    ("version,v", "Print version string")
    ("report-type,r", po::value<string>(&reportType)->default_value("plain"),
     "Report type (html_list, html_collapsible, csv, plain)")
    ("output-path,o", po::value<string>(&outputPath),
     "File to write the report to (fallback: stdout)")
    ("directory", po::value<string>(&directory)->required(), "Working directory")
  ;

  po::positional_options_description p;
  p.add("directory", -1);

  po::variables_map vm;

  po::store(po::command_line_parser(argc, argv).options(desc).positional(p).run(), vm);

  if (vm.count("help")) {
    cout << desc << endl;
    return 0;
  }
  if (vm.count("version")) {
    cout << argv[0] << " version " << MP3REPORT_VERSION_MAJOR << "." << MP3REPORT_VERSION_MINOR << endl;
    return 0;
  }

  try {
    po::notify(vm);
  } catch ( const boost::program_options::error& e ) {
    cerr << e.what() << endl;
    return 1;
  }

  if (vm["report-type"].as<string>() != "html_list" && 
      vm["report-type"].as<string>() != "html_collapsible" &&
      vm["report-type"].as<string>() != "csv" &&
      vm["report-type"].as<string>() != "plain") {
    cerr << "invalid report type (should be one of html_list, html_collapsible, csv or plain)" << endl;
    return 1;
  }

  Reporter reporter(&directory, &reportType, &outputPath);
  reporter.run();
  return 0;
}

{'fraction_non_alphanumeric': 0.1778588807785888, 'fraction_numerical': 0.006812652068126521, 'mean_word_length': 4.1775818639798485, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 35, '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': '5035866', 'n_tokens_mistral': 1404, 'n_tokens_neox': 1360, 'n_words': 330}