<commit_before>﻿using System;
using Cpf;
using Cpf.App;
using LogMagic;
using LogMagic.Enrichers;
using Parquet.CLI.Commands;
using Parquet.CLI.Models;
using static Cpf.PoshConsole;

namespace Parquet.CLI
{
   /// <summary>
   /// This is a parquet.net dotnet CLI tool that can be installed globally. An ultimate replacement for "parq".
   /// It is very much in progress and in design.
   /// </summary>
   class Program
   {
      private static readonly ILog log = L.G(typeof(Program));

      static int Main(string[] args)
      {
         var app = new Application("Parquet CLI (https://github.com/elastacloud/parquet-dotnet)");

         app.OnBeforeExecuteCommand(cmd =>
         {
            PoshWrite("{p}{a}{r}{q} v", ConsoleColor.Yellow, ConsoleColor.Red, ConsoleColor.Green, ConsoleColor.Blue);
            string[] pts = app.Version.Split('.');
            for(int i = 0; i < pts.Length; i++)
            {
               if (i > 0)
                  Write(".", ConsoleColor.DarkGray);

               Write(pts[i], ConsoleColor.Green);
            }
            WriteLine();
         });

         app.OnError((cmd, err) =>
         {
            log.Trace("error in command {command}", cmd.Name, err);
         });

         L.Config.WriteTo.AzureApplicationInsights("0a310ae1-0f93-43fc-bfa1-62e92fc869b9");

         using (L.Context(KnownProperty.OperationId, Guid.NewGuid().ToString()))
         {
            log.Event("Launch",
               "Arguments", string.Join(",", args));

            app.Command("schema", cmd =>
            {
               cmd.Description = Help.Command_Schema_Description;

               Argument<string> path = cmd.Argument<string>("path", Help.Argument_Path).Required();

               cmd.OnExecute(() =>
               {
                  new SchemaCommand(path.Value).Execute();
               });<commit_msg>force collect analytics<commit_after>﻿using System;
using Cpf;
using Cpf.App;
using LogMagic;
using LogMagic.Enrichers;
using Parquet.CLI.Commands;
using Parquet.CLI.Models;
using static Cpf.PoshConsole;

namespace Parquet.CLI
{
   /// <summary>
   /// This is a parquet.net dotnet CLI tool that can be installed globally. An ultimate replacement for "parq".
   /// It is very much in progress and in design.
   /// </summary>
   class Program
   {
      private static readonly ILog log = L.G(typeof(Program));

      static int Main(string[] args)
      {
         var app = new Application("Parquet CLI (https://github.com/elastacloud/parquet-dotnet)");

         app.OnBeforeExecuteCommand(cmd =>
         {
            PoshWrite("{p}{a}{r}{q} v", ConsoleColor.Yellow, ConsoleColor.Red, ConsoleColor.Green, ConsoleColor.Blue);
            string[] pts = app.Version.Split('.');
            for(int i = 0; i < pts.Length; i++)
            {
               if (i > 0)
                  Write(".", ConsoleColor.DarkGray);

               Write(pts[i], ConsoleColor.Green);
            }
            WriteLine();
         });

         app.OnError((cmd, err) =>
         {
            log.Trace("error in command {command}", cmd.Name, err);
         });

         L.Config.WriteTo.AzureApplicationInsights("0a310ae1-0f93-43fc-bfa1-62e92fc869b9", flushOnWrite: true, quickPulse: false);

         using (L.Context(KnownProperty.OperationId, Guid.NewGuid().ToString()))
         {
            log.Event("Launch",
               "Arguments", string.Join(",", args));

            app.Command("schema", cmd =>
            {
               cmd.Description = Help.Command_Schema_Description;

               Argument<string> path = cmd.Argument<string>("path", Help.Argument_Path).Required();

               cmd.OnExecute(() =>
               {
                  new SchemaCommand(path.Value).Execute();
               });
{'fraction_non_alphanumeric': 0.13527080581241743, 'fraction_numerical': 0.011096433289299868, 'mean_word_length': 2.011933174224344, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, 'https://': 2, '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': '7218384', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1070, 'n_words': 238}