mirror of
https://github.com/ShiftOS-Rewind/ShiftOS.git
synced 2025-01-22 17:52:15 +00:00
Improved help and added SFTP
let's see if this works
This commit is contained in:
parent
2950e4546a
commit
8ec044f8c9
4 changed files with 49 additions and 5 deletions
|
@ -6,7 +6,6 @@ namespace ShiftOS.Engine.WindowManager
|
|||
{
|
||||
// ColorData
|
||||
public static Color LeftTopCornerColor = Color.Empty;
|
||||
|
||||
public static Color TitleBarColor = Color.Empty;
|
||||
public static Color RightTopCornerColor = Color.Empty;
|
||||
public static Color BtnCloseColor = Color.Empty;
|
||||
|
|
|
@ -101,6 +101,7 @@
|
|||
</Compile>
|
||||
<Compile Include="Terminal\Commands\Hello.cs" />
|
||||
<Compile Include="Terminal\Commands\Help.cs" />
|
||||
<Compile Include="Terminal\Commands\sftp.cs" />
|
||||
<Compile Include="Terminal\Commands\TestStory.cs" />
|
||||
<Compile Include="Terminal\TerminalBackend.cs" />
|
||||
<Compile Include="Terminal\TerminalCommand.cs" />
|
||||
|
|
|
@ -10,15 +10,38 @@ namespace ShiftOS.Main.Terminal.Commands
|
|||
{
|
||||
public override string Name { get; } = "help";
|
||||
public override string Summary { get; } = "Shows the list of valid commands.";
|
||||
public override string Usage { get; } = "n/a";
|
||||
public override string Usage { get; } = "help <command>";
|
||||
public override bool Unlocked { get; set; } = false;
|
||||
|
||||
public override void Run(params string[] args)
|
||||
{
|
||||
WriteLine("List of valid commands for ShiftOS.\r\n");
|
||||
foreach (var t in TerminalBackend.instances)
|
||||
if (args.Length > 0)
|
||||
{
|
||||
WriteLine($"{t.Name}: {t.Summary}");
|
||||
if (args[0] != null && args[0] != "")
|
||||
{
|
||||
bool solved = false;
|
||||
foreach (var t in TerminalBackend.instances)
|
||||
{
|
||||
if (t.Name == args[0])
|
||||
{
|
||||
solved = true;
|
||||
WriteLine($"{t.Name}: {t.Summary} \nusage: {t.Usage}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!solved)
|
||||
{
|
||||
WriteLine("The command \"" + args[0] + "\" could not be found.");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteLine("List of valid commands for ShiftOS. \nTo get help for a specific command, type \"help <command>\".\r\n");
|
||||
foreach (var t in TerminalBackend.instances)
|
||||
{
|
||||
WriteLine($"{t.Name}: {t.Summary}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
21
ShiftOS.Main/Terminal/Commands/sftp.cs
Normal file
21
ShiftOS.Main/Terminal/Commands/sftp.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ShiftOS.Main.Terminal.Commands
|
||||
{
|
||||
class sftp:TerminalCommand
|
||||
{
|
||||
public override string Name { get; } = "sftp";
|
||||
public override string Summary { get; } = "The Shift File Transfer Protocol (SFTP) Client.";
|
||||
public override string Usage { get; } = "sftp <host> <username> <password> <port (Default - 22)>";
|
||||
public override bool Unlocked { get; set; } = false;
|
||||
|
||||
public override void Run(params string[] args)
|
||||
{
|
||||
WriteLine(args[0]);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue