<commit_before><commit_msg>Add yes.c<commit_after>/*
 * Author: <NAME>
 *
 * yes - output a string repeatedly until killed
 */

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>

typedef enum {false, true} bool;
void printUsage() {
  fprintf(stdout, "Usage: yes [STRING]\n   or: yes [OPTION]\nRepeatedly output a line with all specified STRING(s), or `y'.\n");
  exit(EXIT_SUCCESS);
}

int main(int argc, char *argv[]) {
  int32_t option, i;

  while((option = getopt(argc, argv, "h")) != -1) {
    switch(option) {
      case 'h': printUsage();
      default: fprintf(stderr, "Try 'yes -h' for more information.\n", option);
               exit(EXIT_FAILURE);
    }
  }

  while(true) {
    if(argc == 1) {
      printf("y\n");
    } else {
      for(i = optind; i < argc; i++) {
        printf("%s", argv[i]);
        if(i == (argc - 1)) {
          printf("\n");
        } else {
          printf(" ");
        }
      }
    }
  }

  exit(EXIT_SUCCESS);
}
{'fraction_non_alphanumeric': 0.182720953326713, 'fraction_numerical': 0.004965243296921549, 'mean_word_length': 2.4878892733564015, 'pattern_counts': {'":': 0, '<': 10, '<?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': '7066090', 'n_tokens_mistral': 368, 'n_tokens_neox': 366, 'n_words': 91}