mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-01-31 08:57:29 +01:00
Added option to immediately execute a task
This commit is contained in:
parent
58fef5c307
commit
68e877298a
@ -126,6 +126,21 @@ public static class Tranga_Cli
|
|||||||
return tasks.Length;
|
return tasks.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void ExecuteTask(TaskManager taskManager)
|
||||||
|
{
|
||||||
|
TrangaTask[] tasks = taskManager.GetAllTasks();
|
||||||
|
PrintTasks(tasks);
|
||||||
|
|
||||||
|
Console.WriteLine($"Select Task (0-{tasks.Length - 1}):");
|
||||||
|
|
||||||
|
string? selectedTask = Console.ReadLine();
|
||||||
|
while(selectedTask is null || selectedTask.Length < 1)
|
||||||
|
selectedTask = Console.ReadLine();
|
||||||
|
int selectedTaskIndex = Convert.ToInt32(selectedTask);
|
||||||
|
|
||||||
|
taskManager.ExecuteTaskNow(tasks[selectedTaskIndex]);
|
||||||
|
}
|
||||||
|
|
||||||
private static void RemoveTask(TaskManager taskManager)
|
private static void RemoveTask(TaskManager taskManager)
|
||||||
{
|
{
|
||||||
int length = PrintTasks(taskManager);
|
int length = PrintTasks(taskManager);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user