Files
2026-01-31 15:30:24 +08:00

36 lines
966 B
Swift

// Copyright (c) 2026 Timofey Solomko
// Licensed under MIT License
//
// See LICENSE for license information
import Foundation
import SWCompression
import SwiftCLI
final class ZipCommand: ContainerCommand {
typealias ContainerType = ZipContainer
let name = "zip"
let shortDescription = "Extracts a ZIP container"
@Flag("-i", "--info", description: "Print the information about of the entries in the container including their attributes")
var info: Bool
@Flag("-l", "--list", description: "Print the list of names of the entries in the container")
var list: Bool
@Key("-e", "--extract", description: "Extract a container into the specified directory")
var extract: String?
@Flag("-v", "--verbose", description: "Print the list of extracted files and directories.")
var verbose: Bool
@Param var input: String
var optionGroups: [OptionGroup] {
return [.exactlyOne($info, $list, $extract)]
}
}