<commit_before>/* COPYRIGHT (c) 2014 <NAME>, <NAME>, and <NAME>
 * All rights reserved.
 *
 * \file cmdline.cpp
 * \brief Command-line parsing routines
 *
 */

#include <string.h>
#include <utility>
#include <stdio.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
// NEW: remove useless includes

#include "cmdline.hpp"

namespace pasl {
namespace util {
namespace cmdline {

/***********************************************************************/
/* Command line arguments */

int global_argc = -1;
char** global_argv;
bool print_warning_on_use_of_default_value;

void set(int argc, char** argv)
{
  global_argc = argc;
  global_argv = argv;
  print_warning_on_use_of_default_value = parse_or_default_bool("warning", true, false);
}

std::string name_of_my_executable() {
  return std::string(global_argv[0]);
}

/*---------------------------------------------------------------------*/
/* Auxiliary failure functions */

static void failure()
{
   printf("sError illegal command line\n");
   exit(-1);
}

static void check_set() 
{
  if (global_argc == -1) {
    printf("you must call cmdline::set(argc,argv) in your main.");
    exit(-1);
  }<commit_msg>Disable warnings for default command-line arguments.<commit_after>/* COPYRIGHT (c) 2014 <NAME>, <NAME>, and <NAME>
 * All rights reserved.
 *
 * \file cmdline.cpp
 * \brief Command-line parsing routines
 *
 */

#include <string.h>
#include <utility>
#include <stdio.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
// NEW: remove useless includes

#include "cmdline.hpp"

namespace pasl {
namespace util {
namespace cmdline {

/***********************************************************************/
/* Command line arguments */

int global_argc = -1;
char** global_argv;
bool print_warning_on_use_of_default_value;

void set(int argc, char** argv)
{
  global_argc = argc;
  global_argv = argv;
  print_warning_on_use_of_default_value = parse_or_default_bool("warning", false, false);
}

std::string name_of_my_executable() {
  return std::string(global_argv[0]);
}

/*---------------------------------------------------------------------*/
/* Auxiliary failure functions */

static void failure()
{
   printf("sError illegal command line\n");
   exit(-1);
}

static void check_set() 
{
  if (global_argc == -1) {
    printf("you must call cmdline::set(argc,argv) in your main.");
    exit(-1);
  }
{'fraction_non_alphanumeric': 0.24302788844621515, 'fraction_numerical': 0.007171314741035857, 'mean_word_length': 3.5489130434782608, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '4968743', 'n_tokens_mistral': 816, 'n_tokens_neox': 798, 'n_words': 203}