mirror of
https://github.com/Stone-Red-Code/HyperbolicDownloader.git
synced 2026-09-04 09:06:10 +02:00
Update Console.Commander.NET to the newest version
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Console.Commander.NET" Version="1.0.0" />
|
||||
<PackageReference Include="Console.Commander.NET" Version="1.0.1" />
|
||||
<PackageReference Include="Stone_Red-C-Sharp-Utilities" Version="1.0.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -20,30 +20,31 @@ internal class InputHandler
|
||||
DownloadCommands downloadCommands = new DownloadCommands(hostsManager, filesManager);
|
||||
ClientCommands clientCommands = new ClientCommands();
|
||||
|
||||
commander.Register((_) => Console.Clear(), "clear", "cls");
|
||||
commander.Register((_) => exit = true, "exit", "quit");
|
||||
commander.Register(clientCommands.ShowInfo, "info", "inf");
|
||||
commander.Register(hostCommands.Discover, "discover", "disc");
|
||||
commander.Register(input => commander.PrintHelp(input), "help");
|
||||
commander.Register(_ => Console.Clear(), (HelpText)"Clears the console.", "clear", "cls");
|
||||
commander.Register(_ => exit = true, (HelpText)"Exits the application.", "exit", "quit");
|
||||
commander.Register(clientCommands.ShowInfo, (HelpText)"Displays the private and public IP address.", "info", "inf");
|
||||
commander.Register(hostCommands.Discover, (HelpText)"Tries to find other active hosts on the local network.", "discover", "disc");
|
||||
|
||||
Command getCommand = commander.Register(downloadCommands.GetFile, "get");
|
||||
getCommand.Register(downloadCommands.GetFileFrom, "from");
|
||||
Command getCommand = commander.Register(downloadCommands.GetFile, (HelpText)"Attempts to retrieve a file from another host using a hash.", "get");
|
||||
getCommand.Register(downloadCommands.GetFileFrom, (HelpText)"Attempts to retrieve a file from another host using a .hyper file.", "from");
|
||||
|
||||
Command generateCommad = commander.Register(fileCommands.GenerateFileFull, "generate", "gen");
|
||||
generateCommad.Register(fileCommands.GenerateFileSingle, "noscan");
|
||||
Command generateCommad = commander.Register(fileCommands.GenerateFileFull, (HelpText)"Generates a .hyper file from a file hash.", "generate", "gen");
|
||||
generateCommad.Register(fileCommands.GenerateFileSingle, (HelpText)"Generates a .hyper file from a file hash without checking the known hosts. This adds only the local host to the file.", "noscan");
|
||||
|
||||
Command addCommand = commander.Register(fileCommands.AddFile, "add");
|
||||
addCommand.Register(hostCommands.AddHost, "host");
|
||||
addCommand.Register(fileCommands.AddFile, "file");
|
||||
Command addCommand = commander.Register(fileCommands.AddFile, (HelpText)"Adds a file to the tracking list.", "add");
|
||||
addCommand.Register(fileCommands.AddFile, (HelpText)"Adds a file to the tracking list.", "file");
|
||||
addCommand.Register(hostCommands.AddHost, (HelpText)"Adds a host to the list of known hosts.", "host");
|
||||
|
||||
Command removeCommand = commander.Register(fileCommands.RemoveFile, "remove", "rm");
|
||||
removeCommand.Register(hostCommands.RemoveHost, "host");
|
||||
removeCommand.Register(fileCommands.RemoveFile, "file");
|
||||
Command removeCommand = commander.Register(fileCommands.RemoveFile, (HelpText)"Removes a file from the tracking list.", "remove", "rm");
|
||||
removeCommand.Register(fileCommands.RemoveFile, (HelpText)"Removes a file from the tracking list.", "file");
|
||||
removeCommand.Register(hostCommands.RemoveHost, (HelpText)"Removes a host from the list of known hosts.", "host");
|
||||
|
||||
Command listCommand = commander.Register(fileCommands.ListFiles, "list", "ls");
|
||||
listCommand.Register(fileCommands.ListFiles, "files");
|
||||
listCommand.Register(hostCommands.ListHosts, "hosts");
|
||||
Command listCommand = commander.Register(fileCommands.ListFiles, (HelpText)"Lists all files.", "list", "ls");
|
||||
listCommand.Register(fileCommands.ListFiles, (HelpText)"Lists all files.", "files");
|
||||
listCommand.Register(hostCommands.ListHosts, (HelpText)"lists all hosts.", "hosts");
|
||||
|
||||
commander.Register(hostCommands.CheckActiveHosts, "status", "check");
|
||||
commander.Register(hostCommands.CheckActiveHosts, (HelpText)"Checks the status of known hosts.", "status", "check");
|
||||
}
|
||||
|
||||
public void ReadInput()
|
||||
@@ -59,7 +60,7 @@ internal class InputHandler
|
||||
Console.CursorVisible = false;
|
||||
try
|
||||
{
|
||||
if (!commander.Execute(input))
|
||||
if (!commander.Execute(input, out _))
|
||||
{
|
||||
ConsoleExt.WriteLine("Unknown command!", ConsoleColor.Red);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user