This repository has been archived on 2026-02-12. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
swift-duct-calc/Sources/CLI/Commands/Convert.swift
Michael Housh 291bed28d5
All checks were successful
CI / Linux Tests (push) Successful in 6m44s
feat: Adds minimal cli executable and commands.
2026-02-07 21:17:29 -05:00

36 lines
660 B
Swift

import ArgumentParser
import Dependencies
import ManualDClient
struct ConvertCommand: AsyncParsableCommand {
static let configuration = CommandConfiguration(
commandName: "convert",
abstract: "Convert to an equivalent recangular size."
)
@Option(
name: .shortAndLong,
help: "The height"
)
var height: Int
@Argument(
// name: .shortAndLong,
help: "The round size."
)
var roundSize: Int
func run() async throws {
@Dependency(\.manualD) var manualD
let size = try await manualD.rectangularSize(
round: .init(roundSize),
height: .init(height)
)
print("\(size.width) x \(height)")
}
}