<commit_before>#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

static void print_usage(void);

int main(int argc, const char *argv[]) {
  int tab_width = 8;
  int c;

  if (argc < 2) {
    print_usage();
  }

  while ((c = getopt(argc, argv, "t:")) != -1) {
    switch (c) {
      case 't':
        tab_width = atoi(optarg);
        if (tab_width <= 0) {
          print_usage();
        }
        break;
      default:
        print_usage();
    }
  }

  printf("tab_width: %d\n", tab_width);

  for (size_t i = optind; i < argc; i++) {
    printf("%s\n", argv[i]);
  }

  return 0;
}

static void print_usage(void) {
  fprintf(stderr, "Usage: expand [-t number] [file ...]\n");
  exit(EXIT_FAILURE);
}<commit_msg>it works<commit_after>#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

static void print_usage(void);

int main(int argc, const char *argv[]) {
  int tab_width = 8;
  int c, i;

  if (argc < 2) {
    print_usage();
  }

  while ((c = getopt(argc, argv, "t:")) != -1) {
    switch (c) {
      case 't':
        tab_width = atoi(optarg);
        if (tab_width <= 0) {
          print_usage();
        }
        break;
      default:
        print_usage();
    }
  }

  printf("tab_width: %d\n", tab_width);

  int ch;
  FILE *fp;
  for (i = optind; i < argc; i++) {
    fp = fopen(argv[i], "r");
    if (fp == NULL) {
      fprintf(stderr, "can't open file %s\n", argv[i]);
      exit(EXIT_FAILURE);
    } else {
      while ((ch = fgetc(fp)) != EOF) {
        if (ch == '\t') {
          for (size_t j = 0; j < tab_width; j++) {
            putchar(' ');
          }
        } else {
          putchar(ch);
        }
      }
      fclose(fp);
    }
  }

  return 0;
}

static void print_usage(void) {
  fprintf(stderr, "Usage: expand [-t number] [file ...]\n");
  exit(EXIT_FAILURE);
}
{'fraction_non_alphanumeric': 0.18276619099890232, 'fraction_numerical': 0.0060373216245883645, 'mean_word_length': 2.095076400679117, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 9, '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': '2285746', 'n_tokens_mistral': 715, 'n_tokens_neox': 702, 'n_words': 171}