<commit_before>/*
 * Copyright (c) 2007, Novell Inc.
 *
 * This program is licensed under the BSD license, read LICENSE.BSD
 * for further information
 */

#include <sys/types.h>
#include <limits.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "pool.h"
#include "repo.h"
#include "repo_susetags.h"
#include "repo_content.h"
#include "common_write.h"

int
main(int argc, char **argv)
{
  int with_attr = 0;
  int test_separate = 0;
  const char *contentfile = 0;
  Id vendor = 0;
  argv++;
  argc--;
  while (argc--)
    {
      const char *s = argv[0];
      if (*s++ == '-')
        while (*s)
          switch (*s++)
	    {
	      case 'a': with_attr = 1; break;
	      case 's': test_separate = 1; break;
	      case 'c':
	        if (argc)
		  {
		    contentfile = argv[1];
		    argv++;
		    argc--;
		  }
		break;
	      default : break;
	    }
      argv++;
    }
  Pool *pool = pool_create();
  Repo *repo = repo_create(pool, "<stdin>");<commit_msg>add "-h" for help<commit_after>/*
 * Copyright (c) 2007, Novell Inc.
 *
 * This program is licensed under the BSD license, read LICENSE.BSD
 * for further information
 */

#include <sys/types.h>
#include <limits.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "pool.h"
#include "repo.h"
#include "repo_susetags.h"
#include "repo_content.h"
#include "common_write.h"

static void
usage(void)
{
  fprintf(stderr, "Usage:\n"
          "susetags2solv [-a][-s][-c <content>][-h]\n"
	  "  reads a 'susetags' repository from <stdin> and writes a .solv file to <stdout>\n"
	  "  -a : with attributes\n"
	  "  -c : parse given contentfile (for product information)\n"
	  "  -h : print help & exit\n"
	  "  -s : test separate\n"
	 );
}

int
main(int argc, char **argv)
{
  int with_attr = 0;
  int test_separate = 0;
  const char *contentfile = 0;
  Id vendor = 0;
  argv++;
  argc--;
  while (argc--)
    {
      const char *s = argv[0];
      if (*s++ == '-')
        while (*s)
          switch (*s++)
	    {
	      case 'h': usage(); exit(0);
	      case 'a': with_attr = 1; break;
	      case 's': test_separate = 1; break;
	      case 'c':
	        if (argc)
		  {
		    contentfile = argv[1];
		    argv++;
		    argc--;
		  }
		break;
	      default : break;
	    }
      argv++;
    }
  Pool *pool = pool_create();
  Repo *repo = repo_create(pool, "<stdin>");
{'fraction_non_alphanumeric': 0.16729088639200998, 'fraction_numerical': 0.010819808572617561, 'mean_word_length': 2.405099150141643, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '1740552', 'n_tokens_mistral': 949, 'n_tokens_neox': 890, 'n_words': 248}