Files
SWCompression/Sources/swcomp/Extensions/BlockSize+Keyable.swift
T

20 lines
453 B
Swift

// Copyright (c) 2018 Timofey Solomko
// Licensed under MIT License
//
// See LICENSE for license information
import Foundation
import SwiftCLI
import SWCompression
/// This extension allows to use `BlockSize` as a `Key` option.
extension BZip2.BlockSize: Keyable {
public static func val(from: String) -> BZip2.BlockSize? {
guard let num = Int(from)
else { return nil }
return BZip2.BlockSize(rawValue: num)
}
}