@@ -74,7 +74,7 @@ module Registry =
7474 ("help", "Show help for commands", ["commands"; "?"], Help.execute, Help.help, Help.complete)
7575 ("branch", "Manage development branches", [], Packages.Branch.execute, Packages.Branch.help, Packages.Branch.complete)
7676 ("instance", "Manage remote instances for syncing", [], Instances.execute, Instances.help, Instances.complete)
77- ("sync", "Sync with remote instance ", [], Sync.execute, Sync.help, Sync.complete)
77+ ("sync", "Info about the background sync service ", [], Sync.execute, Sync.help, Sync.complete)
7878 ("config", "Manage CLI configuration", [], Config.execute, Config.help, Config.complete)
7979 ("install", "Install CLI globally", [], Installation.Install.execute, Installation.Install.help, Installation.Install.complete)
8080 ("update", "Update CLI to latest version", ["upgrade"], Installation.Update.execute, Installation.Update.help, Installation.Update.complete)
@@ -462,40 +462,20 @@ let runInteractiveLoop (state: AppState) : Int64 =
462462 runInteractiveLoop newState
463463
464464
465- /// Internal commands
466- /// These are not visible to users and are only invoked programmatically
467- module InternalCommands =
468- let tryExecute (args: List<String>) : Stdlib.Option.Option<Int64> =
469- match args with
470- | ["sync-service-loop"] ->
471- SyncServiceCommands.SyncServiceLoop.execute (initState ()) []
472- Stdlib.Option.Option.Some 0L
473-
474- | ["sync-service-loop"; intervalSecondsStr] ->
475- SyncServiceCommands.SyncServiceLoop.execute (initState ()) [intervalSecondsStr]
476- Stdlib.Option.Option.Some 0L
477-
478- | _ -> Stdlib.Option.Option.None
479-
480-
481465let executeCliCommand (args: List<String>) : Int64 =
482- // First, check for internal commands
483- match InternalCommands.tryExecute args with
484- | Some exitCode -> exitCode
485- | None ->
486- let initialState = initState ()
487-
488- match args with
489- // If someone runs `dark` without args, start the interactive loop
490- | [] ->
491- // Auto-start sync service if not already running
492- SyncService.autoStart ()
493-
494- Stdlib.printLine (View.formatWelcome ())
495- runInteractiveLoop initialState
496- // Otherwise, just execute command, print result, and exit
497- | _ ->
498- let command = args |> Stdlib.String.join " "
499- let finalState = Update.processInput initialState command
500- 0L
466+ let initialState = initState ()
467+
468+ match args with
469+ // If someone runs `dark` without args, start the interactive loop
470+ | [] ->
471+ // Auto-start sync service if not already running
472+ SyncService.autoStart ()
473+
474+ Stdlib.printLine (View.formatWelcome ())
475+ runInteractiveLoop initialState
476+ // Otherwise, just execute command, print result, and exit
477+ | _ ->
478+ let command = args |> Stdlib.String.join " "
479+ let finalState = Update.processInput initialState command
480+ 0L
501481
0 commit comments