Skip to content

Commit 33a871c

Browse files
committed
update example to align with revised API/types
1 parent 40d86a4 commit 33a871c

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

Sources/Formic/IPv4Address.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import ArgumentParser
22
import RegexBuilder
33

44
extension RemoteHost {
5-
65
/// An IPv4 address.
76
public struct IPv4Address: LosslessStringConvertible, Sendable {
87
// It would be great if this were in a standard library built into the swift toolchain (aka Foundation)

examples/updateExample/Sources/updateExample.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import Formic
33
import Foundation
44
import Logging
55

6-
typealias Host = Formic.Host
7-
86
// example:
97
// swift run updateExample -v 172.174.57.17 /Users/heckj/.ssh/bastion_id_ed25519
108

@@ -25,16 +23,16 @@ struct configureBastion: AsyncParsableCommand {
2523
// per https://wiki.debian.org/Multistrap/Environment
2624
let debUnattended = ["DEBIAN_FRONTEND": "noninteractive", "DEBCONF_NONINTERACTIVE_SEEN": "true"]
2725

28-
guard let hostAddress = Host.NetworkAddress(hostname) else {
26+
guard let hostAddress = RemoteHost.NetworkAddress(hostname) else {
2927
fatalError("Unable to parse the provided host address: \(hostname)")
3028
}
3129

3230
let keyName = URL(fileURLWithPath: privateKeyLocation).lastPathComponent
33-
let bastionHost: Host = try Host(hostAddress, sshPort: port, sshUser: user, sshIdentityFile: privateKeyLocation)
34-
let verbosity: Verbosity = verbose ? .debug(emoji: true) : .normal(emoji: true)
31+
let bastionHost: RemoteHost = try RemoteHost(hostAddress, sshPort: port, sshUser: user, sshIdentityFile: privateKeyLocation)
32+
let detailLevel: CommandOutputDetail = verbose ? .debug(emoji: true) : .normal(emoji: true)
3533

3634
try await engine.run(
37-
host: bastionHost, displayProgress: true, verbosity: verbosity,
35+
host: bastionHost, displayProgress: true, detailLevel: detailLevel,
3836
commands: [
3937
SSHCommand("uname -a"), // uses CitadelSSH
4038
SSHCommand("ls -altr"),

0 commit comments

Comments
 (0)