mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
20 lines
471 B
Swift
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)
|
|
}
|
|
|
|
}
|