<commit_before>#!/usr/bin/env swift

#if os(OSX)
    import Darwin
#else
    import Glibc
#endif

import Foundation

let version = "0.5.3"

struct VaporCLI {
    // this closure assignment is necessary to be able to exclude Xcode on Linux
    static let commands: [Command.Type] = {
        var c = [Command.Type]()
        c.append(Help)
        c.append(Version)
        c.append(Clean)
        c.append(Build)
        c.append(Run)
        c.append(New)
        c.append(SelfCommands)
        #if os(OSX)
            c.append(Xcode)
        #endif
        c.append(Heroku)
        c.append(Docker)
        return c
    }()
}

var iterator = Process.arguments.makeIterator()

// FIXME: Sven: this is actually the path to the binary, not the directory
// not sure why this is called directory, perhaps this used to be run through `dirname`?
guard let directory = iterator.next() else {
    fail("no directory")
}
guard let commandId = iterator.next() else {
    print("Usage: \(directory) [\(VaporCLI.commands.map({ $0.id }).joined(separator: "|"))]")
    fail("no command")
}
guard let command = getCommand(id: commandId, commands: VaporCLI.commands) else {
    fail("command \(commandId) doesn't exist")
}

command.assertDependenciesSatisfied()

let arguments = Array(iterator)
command.execute(with: arguments, in: directory)
exit(0)
<commit_msg>Bumped version to 0.6.0<commit_after>#!/usr/bin/env swift

#if os(OSX)
    import Darwin
#else
    import Glibc
#endif

import Foundation

let version = "0.6.0"

struct VaporCLI {
    // this closure assignment is necessary to be able to exclude Xcode on Linux
    static let commands: [Command.Type] = {
        var c = [Command.Type]()
        c.append(Help)
        c.append(Version)
        c.append(Clean)
        c.append(Build)
        c.append(Run)
        c.append(New)
        c.append(SelfCommands)
        #if os(OSX)
            c.append(Xcode)
        #endif
        c.append(Heroku)
        c.append(Docker)
        return c
    }()
}

var iterator = Process.arguments.makeIterator()

// FIXME: Sven: this is actually the path to the binary, not the directory
// not sure why this is called directory, perhaps this used to be run through `dirname`?
guard let directory = iterator.next() else {
    fail("no directory")
}
guard let commandId = iterator.next() else {
    print("Usage: \(directory) [\(VaporCLI.commands.map({ $0.id }).joined(separator: "|"))]")
    fail("no command")
}
guard let command = getCommand(id: commandId, commands: VaporCLI.commands) else {
    fail("command \(commandId) doesn't exist")
}

command.assertDependenciesSatisfied()

let arguments = Array(iterator)
command.execute(with: arguments, in: directory)
exit(0)

{'fraction_non_alphanumeric': 0.12333825701624815, 'fraction_numerical': 0.0048005908419497785, 'mean_word_length': 2.9260869565217393, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5361145', 'n_tokens_mistral': 856, 'n_tokens_neox': 848, 'n_words': 249}