feat: Introduce explicit start, stop, and status commands, including minimum recording duration.
This commit is contained in:
19
Program.cs
19
Program.cs
@@ -23,6 +23,25 @@ public class Program
|
||||
toggleCmd.SetHandler(ToggleCommand.ExecuteAsync, pipeOption, copyOption, verboseOption);
|
||||
rootCommand.AddCommand(toggleCmd);
|
||||
|
||||
// Start Command
|
||||
var startCmd = new Command("start", "Explicitly starts the recording");
|
||||
startCmd.SetHandler(StartCommand.ExecuteAsync, verboseOption);
|
||||
rootCommand.AddCommand(startCmd);
|
||||
|
||||
// Stop Command
|
||||
var stopCmd = new Command("stop", "Explicitly stops the recording");
|
||||
stopCmd.AddOption(pipeOption);
|
||||
stopCmd.AddOption(copyOption);
|
||||
stopCmd.SetHandler(StopCommand.ExecuteAsync, pipeOption, copyOption, verboseOption);
|
||||
rootCommand.AddCommand(stopCmd);
|
||||
|
||||
// Status Command
|
||||
var statusCmd = new Command("status", "Outputs the current daemon status");
|
||||
var jsonOption = new Option<bool>("--json", "Output status as JSON");
|
||||
statusCmd.AddOption(jsonOption);
|
||||
statusCmd.SetHandler(StatusCommand.ExecuteAsync, jsonOption, verboseOption);
|
||||
rootCommand.AddCommand(statusCmd);
|
||||
|
||||
// Daemon Command
|
||||
var daemonCmd = new Command("daemon", "Starts the background service");
|
||||
daemonCmd.SetHandler(Toak.Core.DaemonService.StartAsync, verboseOption);
|
||||
|
||||
Reference in New Issue
Block a user