From 8104a3122703d557a1b1561d93603ab310a775fa Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Wed, 10 Apr 2024 23:11:21 +0100 Subject: [PATCH] more shell completions --- Sources/tart/Commands/IP.swift | 2 +- Sources/tart/Commands/Rename.swift | 2 +- Sources/tart/Commands/Stop.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/tart/Commands/IP.swift b/Sources/tart/Commands/IP.swift index 662d49e2..77d93d2d 100644 --- a/Sources/tart/Commands/IP.swift +++ b/Sources/tart/Commands/IP.swift @@ -13,7 +13,7 @@ enum IPResolutionStrategy: String, ExpressibleByArgument, CaseIterable { struct IP: AsyncParsableCommand { static var configuration = CommandConfiguration(abstract: "Get VM's IP address") - @Argument(help: "VM name") + @Argument(help: "VM name", completion: .custom(completeLocalMachines)) var name: String @Option(help: "Number of seconds to wait for a potential VM booting") diff --git a/Sources/tart/Commands/Rename.swift b/Sources/tart/Commands/Rename.swift index 1f2c0680..70ae351f 100644 --- a/Sources/tart/Commands/Rename.swift +++ b/Sources/tart/Commands/Rename.swift @@ -4,7 +4,7 @@ import Foundation struct Rename: AsyncParsableCommand { static var configuration = CommandConfiguration(abstract: "Rename a VM") - @Argument(help: "VM name") + @Argument(help: "VM name", completion: .custom(completeLocalMachines)) var name: String @Argument(help: "new VM name") diff --git a/Sources/tart/Commands/Stop.swift b/Sources/tart/Commands/Stop.swift index 7f46f4ed..0cc83216 100644 --- a/Sources/tart/Commands/Stop.swift +++ b/Sources/tart/Commands/Stop.swift @@ -6,7 +6,7 @@ import SwiftDate struct Stop: AsyncParsableCommand { static var configuration = CommandConfiguration(commandName: "stop", abstract: "Stop a VM") - @Argument(help: "VM name", completion: .custom(completeLocalMachines)) + @Argument(help: "VM name", completion: .custom(completeRunningMachines)) var name: String @Option(name: [.short, .long], help: "Seconds to wait for graceful termination before forcefully terminating the VM")