<commit_before>//
//  Functions.swift
//  Vrsnr
//
//  Created by <NAME> on 6/27/16.
//  Copyright © 2016 Two Ring Software. All rights reserved.
//

import Foundation

extension String {
    func padLeftToWidth(_ width: Int) -> String {
        if self.characters.count < width {
            return String(repeating: " ", count: width - self.characters.count) + self
        } else {
            return self
        }
    }
}

func printUsage() {
    print("usage: vrsn COMPONENT FLAGS [OPTIONS]")

    print("\nCOMPONENT")
    print("\n\tThe semantic version component to revision. Either “major”, “minor” or “patch”.")

    print("\nFLAGS")
    print("\n\t-\(VrsnrFlags.file.short), --\(VrsnrFlags.file.long) <path>")
    print("\t\tPath to the file that contains the version data.")

    print("\nOPTIONS")
    print("\t-\(VrsnrFlags.key.short), --\(VrsnrFlags.key.long) <key>")
    print("\t\tThe key that the version info is mapped to. Each file type has a default value that is used for each version type if this option is omitted:")


    let columnWidth = 30
    var versionTypeHeaders = "\(String(repeating: " ", count: columnWidth))"
    for versionType in VersionType.allVersionTypes() {
        versionTypeHeaders.append("\(versionType.rawValue.padLeftToWidth(columnWidth))")
    }
    print("\(versionTypeHeaders)")
    print("\(String(repeating: " ", count: columnWidth))\(String(repeating: "=", count: (VersionType.allVersionTypes().count) * columnWidth))")

    for fileType in FileType.allFileTypes() {<commit_msg>remove deprecated calls to .characters<commit_after>//
//  Functions.swift
//  Vrsnr
//
//  Created by <NAME> on 6/27/16.
//  Copyright © 2016 Two Ring Software. All rights reserved.
//

import Foundation

extension String {
    func padLeftToWidth(_ width: Int) -> String {
        if self.count < width {
            return String(repeating: " ", count: width - self.count) + self
        } else {
            return self
        }
    }
}

func printUsage() {
    print("usage: vrsn COMPONENT FLAGS [OPTIONS]")

    print("\nCOMPONENT")
    print("\n\tThe semantic version component to revision. Either “major”, “minor” or “patch”.")

    print("\nFLAGS")
    print("\n\t-\(VrsnrFlags.file.short), --\(VrsnrFlags.file.long) <path>")
    print("\t\tPath to the file that contains the version data.")

    print("\nOPTIONS")
    print("\t-\(VrsnrFlags.key.short), --\(VrsnrFlags.key.long) <key>")
    print("\t\tThe key that the version info is mapped to. Each file type has a default value that is used for each version type if this option is omitted:")


    let columnWidth = 30
    var versionTypeHeaders = "\(String(repeating: " ", count: columnWidth))"
    for versionType in VersionType.allVersionTypes() {
        versionTypeHeaders.append("\(versionType.rawValue.padLeftToWidth(columnWidth))")
    }
    print("\(versionTypeHeaders)")
    print("\(String(repeating: " ", count: columnWidth))\(String(repeating: "=", count: (VersionType.allVersionTypes().count) * columnWidth))")

    for fileType in FileType.allFileTypes() {
{'fraction_non_alphanumeric': 0.14639713074665797, 'fraction_numerical': 0.007173133355070101, 'mean_word_length': 3.1236559139784945, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3918947', 'n_tokens_mistral': 978, 'n_tokens_neox': 930, 'n_words': 256}