<commit_before>#if os(Linux)
  import Glibc
#else
  import Darwin
#endif


/// Extensions to CommandType to provide convinience running methods for CLI tools
extension CommandType {
  /// Run the command using the `Process.argument`, removing the executable name
  public func run(_ version:String? = nil) -> Never  {
    let parser = ArgumentParser(arguments: CommandLine.arguments)

    if parser.hasOption("version") && !parser.hasOption("help") {
      if let version = version {
        print(version)
        exit(0)
      }
    }

    let executableName = parser.shift()!  // Executable Name

    do {
      try run(parser)
    } catch let error as Help {
      let help = error.reraise("$ \(executableName)")
      help.print()
      exit(1)
    } catch GroupError.noCommand(let path, let group) {
      var usage = "$ \(executableName)"
      if let path = path {
        usage += " \(path)"
      }
      let help = Help([], command: usage, group: group)
      help.print()
      exit(1)
    } catch let error as ANSIConvertible {
      error.print()
      exit(1)
    } catch let error as CustomStringConvertible {
      ANSI.red.print(error.description, to: stderr)
      exit(1)
    } catch {
      ANSI.red.print("Unknown error occurred.", to: stderr)
      exit(1)
    }<commit_msg>Print every error in CommandRunner<commit_after>#if os(Linux)
  import Glibc
#else
  import Darwin
#endif


/// Extensions to CommandType to provide convinience running methods for CLI tools
extension CommandType {
  /// Run the command using the `Process.argument`, removing the executable name
  public func run(_ version:String? = nil) -> Never  {
    let parser = ArgumentParser(arguments: CommandLine.arguments)

    if parser.hasOption("version") && !parser.hasOption("help") {
      if let version = version {
        print(version)
        exit(0)
      }
    }

    let executableName = parser.shift()!  // Executable Name

    do {
      try run(parser)
    } catch let error as Help {
      let help = error.reraise("$ \(executableName)")
      help.print()
      exit(1)
    } catch GroupError.noCommand(let path, let group) {
      var usage = "$ \(executableName)"
      if let path = path {
        usage += " \(path)"
      }
      let help = Help([], command: usage, group: group)
      help.print()
      exit(1)
    } catch let error as ANSIConvertible {
      error.print()
      exit(1)
    } catch {
      ANSI.red.print("An error occurred: \(error)", to: stderr)
      exit(1)
    }
{'fraction_non_alphanumeric': 0.11670663469224621, 'fraction_numerical': 0.004396482813749001, 'mean_word_length': 2.5056022408963585, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3295385', 'n_tokens_mistral': 747, 'n_tokens_neox': 729, 'n_words': 226}