File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,11 @@ struct Run: SwiftlyCommand {
6969 throw CleanExit . helpRequest ( self )
7070 }
7171
72+ // Handle the spcific case where version is requested of the run subcommand
73+ if command == [ " --version " ] {
74+ throw CleanExit . message ( String ( describing: SwiftlyCore . version) )
75+ }
76+
7277 let ( command, selector) = try Self . extractProxyArguments ( command: self . command)
7378
7479 let toolchain : ToolchainVersion ?
Original file line number Diff line number Diff line change @@ -107,4 +107,15 @@ import Testing
107107 #expect( error is CleanExit )
108108 }
109109 }
110+
111+ /// Tests the version functionality of the `run` command
112+ @Test ( . testHomeMockedToolchain( ) ) func runVersion( ) async throws {
113+ // Test --version is handled correctly
114+ do {
115+ try await SwiftlyTests . runCommand ( Run . self, [ " run " , " --version " ] )
116+ #expect( false )
117+ } catch {
118+ #expect( error is CleanExit )
119+ }
120+ }
110121}
You can’t perform that action at this time.
0 commit comments