Skip to content

Commit 5e44442

Browse files
committed
Use default --version and --help implementation
1 parent 7b0bdb0 commit 5e44442

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

Sources/hostmgr/main.swift

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import libhostmgr
55

66
struct Hostmgr: ParsableCommand {
77

8-
private var appVersion = "0.14.1"
8+
private static var appVersion = "0.14.2"
99

1010
static var configuration = CommandConfiguration(
1111
abstract: "A utility for managing VM hosts",
12+
version: appVersion,
1213
subcommands: [
1314
VMCommand.self,
1415
SyncCommand.self,
@@ -18,25 +19,6 @@ struct Hostmgr: ParsableCommand {
1819
BenchmarkCommand.self,
1920
ConfigCommand.self
2021
])
21-
22-
@Flag(help: "Print the version and exit")
23-
var version: Bool = false
24-
25-
func run() throws {
26-
guard version == false else {
27-
print(appVersion)
28-
return
29-
}
30-
31-
logger.debug("Starting Up")
32-
33-
guard Configuration.isValid else {
34-
print("Invalid configuration – exiting")
35-
throw ExitCode(1)
36-
}
37-
38-
throw CleanExit.helpRequest(self)
39-
}
4022
}
4123

4224
initializeLoggingSystem()

0 commit comments

Comments
 (0)