<commit_before>// Copyright (c) 2017 <NAME>
// Licensed under MIT License
//
// See LICENSE for license information

import Foundation
import SWCompression
import SwiftCLI

class GZipCommand: Command {

    let name = "gz"
    let shortDescription = "Creates or extracts GZip archive"

    let compress = Flag("-c", "--compress", description: "Compress input file into GZip archive")
    let decompress = Flag("-d", "--decompress", description: "Decompress GZip archive")

    var optionGroups: [OptionGroup] {
        let actions = OptionGroup(options: [compress, decompress], restriction: .exactlyOne)
        return [actions]
    }

    let input = Parameter()
    let output = OptionalParameter()

    func execute() throws {
        if decompress.value {
            let inputURL = URL(fileURLWithPath: self.input.value)

            let outputURL: URL
            print(inputURL.pathExtension) // TODO:
            if let outputPath = output.value {
                outputURL = URL(fileURLWithPath: outputPath)
            } else if inputURL.pathExtension == "gz" {
                outputURL = inputURL.deletingPathExtension()
            } else {
                fatalError("""
                           Unable to get output path.
                           No output parameter was specified.
                           Extension was: \(inputURL.pathExtension)
                           """)
            }
<commit_msg>Remove unused print statement<commit_after>// Copyright (c) 2017 <NAME>
// Licensed under MIT License
//
// See LICENSE for license information

import Foundation
import SWCompression
import SwiftCLI

class GZipCommand: Command {

    let name = "gz"
    let shortDescription = "Creates or extracts GZip archive"

    let compress = Flag("-c", "--compress", description: "Compress input file into GZip archive")
    let decompress = Flag("-d", "--decompress", description: "Decompress GZip archive")

    var optionGroups: [OptionGroup] {
        let actions = OptionGroup(options: [compress, decompress], restriction: .exactlyOne)
        return [actions]
    }

    let input = Parameter()
    let output = OptionalParameter()

    func execute() throws {
        if decompress.value {
            let inputURL = URL(fileURLWithPath: self.input.value)

            let outputURL: URL
            if let outputPath = output.value {
                outputURL = URL(fileURLWithPath: outputPath)
            } else if inputURL.pathExtension == "gz" {
                outputURL = inputURL.deletingPathExtension()
            } else {
                fatalError("""
                           Unable to get output path.
                           No output parameter was specified.
                           Extension was: \(inputURL.pathExtension)
                           """)
            }

{'fraction_non_alphanumeric': 0.09010287335934729, 'fraction_numerical': 0.002837885775097552, 'mean_word_length': 2.0063965884861408, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5194012', 'n_tokens_mistral': 717, 'n_tokens_neox': 680, 'n_words': 225}