Compare commits
No commits in common. "b040419e126f0e244d25ffc1549e772742b1b5a7" and "e499062fd5741824c465bf030af1408999610552" have entirely different histories.
b040419e12
...
e499062fd5
@ -8,18 +8,12 @@ public static class Tranga_Cli
|
|||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
string folderPath = Directory.GetCurrentDirectory();
|
Console.WriteLine("Output folder path [standard D:]:");
|
||||||
string settingsPath = Path.Join(Directory.GetCurrentDirectory(), "lastPath.setting");
|
string? folderPath = Console.ReadLine();
|
||||||
if (File.Exists(settingsPath))
|
while(folderPath is null )
|
||||||
folderPath = File.ReadAllText(settingsPath);
|
folderPath = Console.ReadLine();
|
||||||
|
if (folderPath.Length < 1)
|
||||||
Console.WriteLine($"Output folder path [{folderPath}]:");
|
folderPath = "D:";
|
||||||
string? tmpPath = Console.ReadLine();
|
|
||||||
while(tmpPath is null)
|
|
||||||
tmpPath = Console.ReadLine();
|
|
||||||
if(tmpPath.Length > 0)
|
|
||||||
folderPath = tmpPath;
|
|
||||||
File.WriteAllText(settingsPath, folderPath);
|
|
||||||
|
|
||||||
Console.Write("Mode (D: Interactive only, T: TaskManager):");
|
Console.Write("Mode (D: Interactive only, T: TaskManager):");
|
||||||
ConsoleKeyInfo mode = Console.ReadKey();
|
ConsoleKeyInfo mode = Console.ReadKey();
|
||||||
@ -112,11 +106,12 @@ public static class Tranga_Cli
|
|||||||
int taskRunningCount = taskManager.GetAllTasks().Count(task => task.isBeingExecuted);
|
int taskRunningCount = taskManager.GetAllTasks().Count(task => task.isBeingExecuted);
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
Console.WriteLine($"Download Folder: {folderPath} Tasks (Running/Total): {taskRunningCount}/{taskCount}");
|
Console.WriteLine($"Download Folder: {folderPath} Tasks (Running/Total): {taskRunningCount}/{taskCount}");
|
||||||
|
Console.WriteLine("Select Option:");
|
||||||
Console.WriteLine("L: List tasks");
|
Console.WriteLine("L: List tasks");
|
||||||
Console.WriteLine("C: Create Task");
|
Console.WriteLine("C: Create Task");
|
||||||
Console.WriteLine("D: Delete Task");
|
Console.WriteLine("D: Delete Task");
|
||||||
Console.WriteLine("E: Execute Task now");
|
Console.WriteLine("E: Execute Task now");
|
||||||
Console.WriteLine("Q: Exit");
|
Console.WriteLine("Q: Exit with saving");
|
||||||
ConsoleKey selection = Console.ReadKey().Key;
|
ConsoleKey selection = Console.ReadKey().Key;
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
return selection;
|
return selection;
|
||||||
@ -136,15 +131,9 @@ public static class Tranga_Cli
|
|||||||
private static void ExecuteTask(TaskManager taskManager)
|
private static void ExecuteTask(TaskManager taskManager)
|
||||||
{
|
{
|
||||||
TrangaTask[] tasks = taskManager.GetAllTasks();
|
TrangaTask[] tasks = taskManager.GetAllTasks();
|
||||||
if (tasks.Length < 1)
|
|
||||||
{
|
|
||||||
Console.Clear();
|
|
||||||
Console.WriteLine("There are no available Tasks.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
PrintTasks(tasks);
|
PrintTasks(tasks);
|
||||||
|
|
||||||
Console.WriteLine($"Select Task (0-{tasks.Length}):");
|
Console.WriteLine($"Select Task (0-{tasks.Length - 1}):");
|
||||||
|
|
||||||
string? selectedTask = Console.ReadLine();
|
string? selectedTask = Console.ReadLine();
|
||||||
while(selectedTask is null || selectedTask.Length < 1)
|
while(selectedTask is null || selectedTask.Length < 1)
|
||||||
@ -157,15 +146,9 @@ public static class Tranga_Cli
|
|||||||
private static void RemoveTask(TaskManager taskManager)
|
private static void RemoveTask(TaskManager taskManager)
|
||||||
{
|
{
|
||||||
TrangaTask[] tasks = taskManager.GetAllTasks();
|
TrangaTask[] tasks = taskManager.GetAllTasks();
|
||||||
if (tasks.Length < 1)
|
|
||||||
{
|
|
||||||
Console.Clear();
|
|
||||||
Console.WriteLine("There are no available Tasks.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
PrintTasks(tasks);
|
PrintTasks(tasks);
|
||||||
|
|
||||||
Console.WriteLine($"Select Task (0-{tasks.Length}):");
|
Console.WriteLine($"Select Task (0-{tasks.Length - 1}):");
|
||||||
|
|
||||||
string? selectedTask = Console.ReadLine();
|
string? selectedTask = Console.ReadLine();
|
||||||
while(selectedTask is null || selectedTask.Length < 1)
|
while(selectedTask is null || selectedTask.Length < 1)
|
||||||
@ -184,7 +167,7 @@ public static class Tranga_Cli
|
|||||||
Console.WriteLine("Available Tasks:");
|
Console.WriteLine("Available Tasks:");
|
||||||
foreach (string taskName in taskNames)
|
foreach (string taskName in taskNames)
|
||||||
Console.WriteLine($"{tIndex++}: {taskName}");
|
Console.WriteLine($"{tIndex++}: {taskName}");
|
||||||
Console.WriteLine($"Select Task (0-{taskNames.Length}):");
|
Console.WriteLine($"Select Task (0-{taskNames.Length - 1}):");
|
||||||
|
|
||||||
string? selectedTask = Console.ReadLine();
|
string? selectedTask = Console.ReadLine();
|
||||||
while(selectedTask is null || selectedTask.Length < 1)
|
while(selectedTask is null || selectedTask.Length < 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user