Files
SWCompression/Sources/swcomp/Extensions/BlockSize+Keyable.swift
2021-01-11 11:20:57 +02:00

20 lines
471 B
Swift

// Copyright (c) 2021 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: ConvertibleFromString {
public static func convert(from: String) -> BZip2.BlockSize? {
guard let num = Int(from)
else { return nil }
return BZip2.BlockSize(rawValue: num)
}
}