Skip to content

Commit e85fb58

Browse files
committed
Removes ArgumentParser import from NetworkMode.
- ContainerResources shouldn't need to know anything about CLI stuff. - Move ExpressibleByArgument protocol conformance to an extension in the package where it's needed.
1 parent 3abf81f commit e85fb58

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Sources/ContainerResource/Network/NetworkMode.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
// limitations under the License.
1515
//===----------------------------------------------------------------------===//
1616

17-
import ArgumentParser
18-
1917
/// Networking mode that applies to client containers.
20-
public enum NetworkMode: String, Codable, Sendable, ExpressibleByArgument {
18+
public enum NetworkMode: String, Codable, Sendable {
2119
/// NAT networking mode.
2220
/// Containers do not have routable IPs, and the host performs network
2321
/// address translation to allow containers to reach external services.

Sources/Helpers/NetworkVmnet/NetworkVmnetHelper+Start.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ enum Variant: String, ExpressibleByArgument {
2929
case allocationOnly
3030
}
3131

32+
extension NetworkMode: ExpressibleByArgument {}
33+
3234
extension NetworkVmnetHelper {
3335
struct Start: AsyncParsableCommand {
3436
static let configuration = CommandConfiguration(

0 commit comments

Comments
 (0)