Skip to content

Commit 123dcc1

Browse files
committed
fix: Handle new SpectreConsole signature with CancellationToken
1 parent 9c13ff4 commit 123dcc1

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

extLauncher/Program.fs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ module private Implementations =
119119
type PromptCommand() =
120120
inherit Command()
121121

122-
override _.Execute c =
122+
override _.Execute(_context, _cancellationToken) =
123123
findFolder ()
124124
|> Option.map (prompt >> fun () -> 0)
125125
|> Option.defaultWith notInitialized
@@ -142,7 +142,7 @@ type IndexSettings() =
142142
type IndexCommand() =
143143
inherit Command<IndexSettings>()
144144

145-
override _.Execute(_, settings) =
145+
override _.Execute(_context, settings, _cancellationToken) =
146146
(fun _ ->
147147
App.index IO.getFiles Db.upsertFolder {
148148
Path = currentPath
@@ -191,7 +191,7 @@ type RemoveLauncherSettings() =
191191
type SetLauncherCommand() =
192192
inherit Command<SetLauncherSettings>()
193193

194-
override _.Execute(_, settings) =
194+
override _.Execute(_, settings, _cancellationToken) =
195195
match findFolder () with
196196
| None -> notInitialized ()
197197
| Some folder ->
@@ -222,7 +222,7 @@ type SetLauncherCommand() =
222222
type RemoveLauncherCommand() =
223223
inherit Command<RemoveLauncherSettings>()
224224

225-
override _.Execute(_, settings) =
225+
override _.Execute(_, settings, _cancellationToken) =
226226
match findFolder () with
227227
| None -> notInitialized ()
228228
| Some folder ->
@@ -245,7 +245,7 @@ type RemoveLauncherCommand() =
245245
type DeindexCommand() =
246246
inherit Command()
247247

248-
override _.Execute _ =
248+
override _.Execute(_context, _cancellationToken) =
249249
match Db.findFolder currentPath with
250250
| None -> notInitialized ()
251251
| Some folder ->
@@ -256,7 +256,7 @@ type DeindexCommand() =
256256
type InfoCommand() =
257257
inherit Command()
258258

259-
override _.Execute _ =
259+
override _.Execute(_context, _cancellationToken) =
260260
match findFolder () with
261261
| None -> notInitialized ()
262262
| Some folder ->
@@ -316,7 +316,7 @@ type InfoCommand() =
316316
type RefreshCommand() =
317317
inherit Command()
318318

319-
override _.Execute _ =
319+
override _.Execute(_context, _cancellationToken) =
320320
match findFolder () with
321321
| None -> notInitialized ()
322322
| Some folder ->
@@ -337,16 +337,12 @@ module Program =
337337

338338
conf
339339
.AddCommand<PromptCommand>("prompt")
340-
.WithDescription(
341-
"[italic](default command)[/] Type to search. Arrows Up/Down to navigate. Enter to launch. Escape to quit."
342-
)
340+
.WithDescription("[italic](default command)[/] Type to search. Arrows Up/Down to navigate. Enter to launch. Escape to quit.")
343341
|> ignore
344342

345343
conf
346344
.AddCommand<IndexCommand>("index")
347-
.WithDescription(
348-
"Indexes all files recursively with a specific pattern which can be a wildcard [italic](default)[/] or a regular expression."
349-
)
345+
.WithDescription("Indexes all files recursively with a specific pattern which can be a wildcard [italic](default)[/] or a regular expression.")
350346
|> ignore
351347

352348
conf.AddBranch<LauncherSettings>(
@@ -365,9 +361,7 @@ module Program =
365361
conf.AddCommand<DeindexCommand>("deindex").WithDescription("Clears the current index.")
366362
|> ignore
367363

368-
conf
369-
.AddCommand<InfoCommand>("info")
370-
.WithDescription("Prints the current pattern and all the indexed files.")
364+
conf.AddCommand<InfoCommand>("info").WithDescription("Prints the current pattern and all the indexed files.")
371365
|> ignore
372366

373367
conf.AddCommand<RefreshCommand>("refresh").WithDescription("Updates the current index.")

0 commit comments

Comments
 (0)