<commit_before>#include <stdio.h>
#include <unistd.h>
#include <getopt.h>
#include <signal.h>
#include "common.h"
#include "mmu.h"
#include "mmu_fallback.h"
#include "ram.h"
#include "rom.h"
#include "cpu.h"
#include "psg.h"
#include "midi.h"
#include "ikbd.h"
#include "diag.h"
#if INCLUDE_RTC
#include "rtc.h"
#endif
#include "dma.h"
#include "fdc.h"
#include "hdc.h"
#include "mfp.h"
#include "prefs.h"
#include "shifter.h"
#include "screen.h"
#include "floppy.h"
#include "debug/debug.h"
#include "cartridge.h"
#include "state.h"
#if TEST_BUILD
#include "tests/test_main.h"
#endif

int debugger = 0;
int ppmoutput = 0;
int psgoutput = 0;
int vsync_delay = 0;
int play_audio = 0;
int audio_device = 0;
int monitor_sm124 = 0;
int crop_screen = 0;
int verbosity = 3;

#if TEST_BUILD
int test_mode = 0;
char *test_case_name;
#define OPT_TEST_MODE            99999
#endif


#define OPT_CART                 10000
#define OPT_FORCE_EXTREME_DISASM 10001
#define OPT_CROP_SCREEN          10002
#define OPT_LOGLEVELS            10003
#define OPT_AUDIO_DEVICE         10004

struct sigaction reset;

static void reset_action(int sig, siginfo_t *info, void *x)
{
  cpu_reset();
}

int main(int argc, char *argv[])
{
  int c;
  struct state *state = NULL;
#if TEST_BUILD
  struct test_case *test_case;
#endif
  prefs_init();

  while(1) {
    int option_index = 0;
    static struct option long_options[] = {
      {"cart",                  required_argument, 0, OPT_CART },
      {"force-extreme-disasm",  no_argument,       0, OPT_FORCE_EXTREME_DISASM },
      {"crop-screen",           no_argument,       0, OPT_CROP_SCREEN },
      {"loglevels" ,            required_argument, 0, OPT_LOGLEVELS },
      {"audio-device" ,         required_argument, 0, OPT_AUDIO_DEVICE },
#if TEST_BUILD
      {"test-case",             required_argument, 0, OPT_TEST_MODE},
#endif
      {0,                       0,                 0, 0 }
    };
    c = getopt_long(argc, argv, "a:b:c:t:s:hdpyVAMvq", long_options, &option_index);
    if(c == -1) break;

    switch(c) {
    case 'a':
      prefs_set("diskimage", optarg);
      break;
    case 'b':
      prefs_set("diskimage2", optarg);
      break;
    case 'c':
      prefs_set("hdimage", optarg);
      break;
    case 't':
      prefs_set("tosimage", optarg);
      break;
    case 's':
      prefs_set("stateimage", optarg);
      break;
    case OPT_CART:
      prefs_set("cartimage", optarg);
      break;
    case OPT_FORCE_EXTREME_DISASM:
      cprint_all = 1;
      break;
    case OPT_CROP_SCREEN:
      crop_screen = 1;
      break;
    case OPT_LOGLEVELS:
      diag_set_module_levels(optarg);
      break;
    case OPT_AUDIO_DEVICE:
      if(!strncmp("list", optarg, 4)) {
        audio_device = -1;
      } else {
        audio_device = atoi(optarg);
      }
      break;
#if TEST_BUILD
    case OPT_TEST_MODE:
      test_case_name = strdup(optarg);
      test_mode = 1;
      break;
#endif
    case 'd':
      debugger = 1;
      break;
    case 'p':
      ppmoutput = 1;
      break;
    case 'y':
      psgoutput = 1;
      break;
    case 'v':
      verbosity++;
      break;
    case 'q':
      verbosity = MAX(1, verbosity-1);
      break;
    case 'V':
      vsync_delay = 1;
      break;
    case 'A':
      play_audio = 1;
      break;
    case 'M':
      monitor_sm124 = 1;
      break;
    case 'h':
    default:
      printf("Usage: %s [-a diskimage] [-t tosimage] [-s stateimage] [-h] [-d] [-p] [-v]\n",
	     argv[0]);
      exit(-1);
      break;
    }
  }<commit_msg>Update the -h output to include all the available options<commit_after>#include <stdio.h>
#include <unistd.h>
#include <getopt.h>
#include <signal.h>
#include "common.h"
#include "mmu.h"
#include "mmu_fallback.h"
#include "ram.h"
#include "rom.h"
#include "cpu.h"
#include "psg.h"
#include "midi.h"
#include "ikbd.h"
#include "diag.h"
#if INCLUDE_RTC
#include "rtc.h"
#endif
#include "dma.h"
#include "fdc.h"
#include "hdc.h"
#include "mfp.h"
#include "prefs.h"
#include "shifter.h"
#include "screen.h"
#include "floppy.h"
#include "debug/debug.h"
#include "cartridge.h"
#include "state.h"
#if TEST_BUILD
#include "tests/test_main.h"
#endif

int debugger = 0;
int ppmoutput = 0;
int psgoutput = 0;
int vsync_delay = 0;
int play_audio = 0;
int audio_device = 0;
int monitor_sm124 = 0;
int crop_screen = 0;
int verbosity = 3;

#if TEST_BUILD
int test_mode = 0;
char *test_case_name;
#define OPT_TEST_MODE            99999
#endif


#define OPT_CART                 10000
#define OPT_FORCE_EXTREME_DISASM 10001
#define OPT_CROP_SCREEN          10002
#define OPT_LOGLEVELS            10003
#define OPT_AUDIO_DEVICE         10004

struct sigaction reset;

static void reset_action(int sig, siginfo_t *info, void *x)
{
  cpu_reset();
}

int main(int argc, char *argv[])
{
  int c;
  struct state *state = NULL;
#if TEST_BUILD
  struct test_case *test_case;
#endif
  prefs_init();

  while(1) {
    int option_index = 0;
    static struct option long_options[] = {
      {"cart",                  required_argument, 0, OPT_CART },
      {"force-extreme-disasm",  no_argument,       0, OPT_FORCE_EXTREME_DISASM },
      {"crop-screen",           no_argument,       0, OPT_CROP_SCREEN },
      {"loglevels" ,            required_argument, 0, OPT_LOGLEVELS },
      {"audio-device" ,         required_argument, 0, OPT_AUDIO_DEVICE },
#if TEST_BUILD
      {"test-case",             required_argument, 0, OPT_TEST_MODE},
#endif
      {0,                       0,                 0, 0 }
    };
    c = getopt_long(argc, argv, "a:b:c:t:s:hdpyVAMvq", long_options, &option_index);
    if(c == -1) break;

    switch(c) {
    case 'a':
      prefs_set("diskimage", optarg);
      break;
    case 'b':
      prefs_set("diskimage2", optarg);
      break;
    case 'c':
      prefs_set("hdimage", optarg);
      break;
    case 't':
      prefs_set("tosimage", optarg);
      break;
    case 's':
      prefs_set("stateimage", optarg);
      break;
    case OPT_CART:
      prefs_set("cartimage", optarg);
      break;
    case OPT_FORCE_EXTREME_DISASM:
      cprint_all = 1;
      break;
    case OPT_CROP_SCREEN:
      crop_screen = 1;
      break;
    case OPT_LOGLEVELS:
      diag_set_module_levels(optarg);
      break;
    case OPT_AUDIO_DEVICE:
      if(!strncmp("list", optarg, 4)) {
        audio_device = -1;
      } else {
        audio_device = atoi(optarg);
      }
      break;
#if TEST_BUILD
    case OPT_TEST_MODE:
      test_case_name = strdup(optarg);
      test_mode = 1;
      break;
#endif
    case 'd':
      debugger = 1;
      break;
    case 'p':
      ppmoutput = 1;
      break;
    case 'y':
      psgoutput = 1;
      break;
    case 'v':
      verbosity++;
      break;
    case 'q':
      verbosity = MAX(1, verbosity-1);
      break;
    case 'V':
      vsync_delay = 1;
      break;
    case 'A':
      play_audio = 1;
      break;
    case 'M':
      monitor_sm124 = 1;
      break;
    case 'h':
    default:
      printf("Usage: %s [-AdMpqvVy] [-a diskimage1] [-b diskimage2] [-c hdimage] [-t tosimage] [-s stateimage]\n",
	     argv[0]);
      exit(-1);
      break;
    }
  }
{'fraction_non_alphanumeric': 0.13226621735467564, 'fraction_numerical': 0.02134231957315361, 'mean_word_length': 2.4195871339414308, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7066229', 'n_tokens_mistral': 2793, 'n_tokens_neox': 2660, 'n_words': 640}