mirror of
https://github.com/Lakr233/vphone-cli.git
synced 2026-09-02 02:34:29 +00:00
The library the consolidated CLI is built on: - bundle/library model (VPhoneBundle, VPhoneLibrary, VPhoneVirtualMachineManifest), bundle ops + reporting, restore helpers (VPhoneRestoreOps) - host process primitives: VPhoneProcessRunner, VPhoneManagedProcess (spawn + stdout pattern-match + SIGKILL-escalating terminate), VPhoneLaunchLayout, VPhoneBootPatterns - VPhoneResources: bundled-.app vs dev asset resolution, and Python resolution that provisions a per-user venv (~/.vphone/venv) on demand so the app is portable — never depends on the repo's .venv - VPhoneVerbosity (quiet/info/debug/trace) and VPhoneVMPicker Manifest moves out of the executable target into VPhoneCore. Full unit-test suite under tests/VPhoneCoreTests. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01Y4VDqWf5pVakcFLqB23CKe
24 lines
1.0 KiB
Swift
24 lines
1.0 KiB
Swift
/// CLI output verbosity. Higher levels are supersets of lower ones.
|
|
///
|
|
/// The guest VM serial console is deliberately NOT part of this ladder:
|
|
/// `vm launch` always streams it, `vm create` never does — neither depends
|
|
/// on the verbosity level.
|
|
public enum VPhoneVerbosity: Int, Comparable, Sendable {
|
|
case quiet = 0 // tool banners + [*]/[+] markers only
|
|
case info = 1 // + wrapped-subprocess stdout + pmd3 restore log (INFO, colorful)
|
|
case debug = 2 // + pmd3 DEBUG logs (deeper restore detail)
|
|
case trace = 3 // + vphone-cli internal trace (spawned argv/env, managed-process events)
|
|
|
|
public static func < (lhs: VPhoneVerbosity, rhs: VPhoneVerbosity) -> Bool {
|
|
lhs.rawValue < rhs.rawValue
|
|
}
|
|
|
|
/// Map a repeated `-v` count (0…N) to a level, clamped to `.trace`.
|
|
public init(count: Int) {
|
|
self = VPhoneVerbosity(rawValue: min(max(count, 0), 3)) ?? .trace
|
|
}
|
|
|
|
public var showsToolDetail: Bool { self >= .info }
|
|
public var tracesInternals: Bool { self >= .trace }
|
|
}
|