90 lines
2.0 KiB
C#
90 lines
2.0 KiB
C#
using Manager;
|
|
using Models.Model.Backend;
|
|
|
|
bool stop = false;
|
|
|
|
do
|
|
{
|
|
string? input = Console.ReadLine();
|
|
|
|
if (string.Equals(input, "stop"))
|
|
{
|
|
Commands.StopServer();
|
|
}
|
|
|
|
else if (string.Equals(input, "q"))
|
|
{
|
|
stop = true;
|
|
}
|
|
|
|
else if (string.Equals(input, "clear"))
|
|
{
|
|
Console.Clear();
|
|
}
|
|
|
|
else if (string.Equals(input, "p"))
|
|
{
|
|
Commands.GetProgress();
|
|
}
|
|
|
|
else if (string.Equals(input, "v"))
|
|
{
|
|
Commands.Vacuum();
|
|
}
|
|
|
|
else if (string.Equals(input, "r"))
|
|
{
|
|
Commands.ReIndex();
|
|
}
|
|
|
|
else if (string.Equals(input, "R"))
|
|
{
|
|
Console.WriteLine("Variable name.");
|
|
string? variable = Console.ReadLine();
|
|
|
|
Console.WriteLine("Variable value.");
|
|
string? value = Console.ReadLine();
|
|
|
|
if (string.IsNullOrWhiteSpace(variable) || string.IsNullOrWhiteSpace(value))
|
|
{
|
|
Console.WriteLine("Please enter a value.");
|
|
return;
|
|
}
|
|
|
|
if (variable == RuntimeVariable.ScannerTimeout.ToString())
|
|
{
|
|
Commands.SetRuntimeVariable(RuntimeVariable.ScannerTimeout, value);
|
|
}
|
|
|
|
else if (variable == RuntimeVariable.ContentFilter.ToString())
|
|
{
|
|
Commands.SetRuntimeVariable(RuntimeVariable.ContentFilter, value);
|
|
}
|
|
|
|
else if (variable == RuntimeVariable.DbDiscarded.ToString())
|
|
{
|
|
Commands.SetRuntimeVariable(RuntimeVariable.DbDiscarded, value);
|
|
}
|
|
|
|
else if (variable == RuntimeVariable.DbContent.ToString())
|
|
{
|
|
Commands.SetRuntimeVariable(RuntimeVariable.DbContent, value);
|
|
}
|
|
}
|
|
|
|
else if (string.Equals(input, "lR"))
|
|
{
|
|
Commands.PrintRuntimeVariables();
|
|
}
|
|
|
|
else if (string.Equals(input, "help"))
|
|
{
|
|
Commands.GetHelp();
|
|
}
|
|
|
|
else
|
|
{
|
|
Commands.GetHelp();
|
|
}
|
|
|
|
} while (!stop); |