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
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
753 B
Swift

import ArgumentParser
import Dependencies
import ManualDClient
struct SizeCommand: AsyncParsableCommand {
static let configuration = CommandConfiguration(
commandName: "size",
abstract: "Calculate the required size of a duct."
)
@Option(
name: .shortAndLong,
help: "The design friction rate."
)
var frictionRate: Double = 0.06
@Argument(
help: "The required CFM for the duct."
)
var cfm: Int
func run() async throws {
@Dependency(\.manualD) var manualD
let size = try await manualD.ductSize(cfm: cfm, frictionRate: frictionRate)
print(
"""
Calculated: \(size.calculatedSize.string(digits: 2))
Final Size: \(size.finalSize)
Flex Size: \(size.flexSize)
"""
)
}
}