File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ struct ListAvailable: SwiftlyCommand {
49
49
try ToolchainSelector ( parsing: input)
50
50
}
51
51
52
- let config = try Config . load ( ctx)
52
+ var config = try Config . load ( ctx)
53
53
54
54
let tc : [ ToolchainVersion ]
55
55
@@ -71,15 +71,19 @@ struct ListAvailable: SwiftlyCommand {
71
71
let toolchains = tc. filter { selector? . matches ( toolchain: $0) ?? true }
72
72
73
73
let installedToolchains = Set ( config. listInstalledToolchains ( selector: selector) )
74
- let activeToolchain = config. inUse
74
+ let ( inUse , _ ) = try await selectToolchain ( ctx , config: & config )
75
75
76
76
let printToolchain = { ( toolchain: ToolchainVersion ) in
77
77
var message = " \( toolchain) "
78
- if toolchain == activeToolchain {
79
- message += " (installed, in use) "
80
- } else if installedToolchains. contains ( toolchain) {
78
+ if installedToolchains. contains ( toolchain) {
81
79
message += " (installed) "
82
80
}
81
+ if let inUse, toolchain == inUse {
82
+ message += " (in use) "
83
+ }
84
+ if toolchain == config. inUse {
85
+ message += " (default) "
86
+ }
83
87
await ctx. print ( message)
84
88
}
85
89
You can’t perform that action at this time.
0 commit comments