aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Main/Terminal/Commands/Help.cs
diff options
context:
space:
mode:
authorAShifter <[email protected]>2017-11-21 15:12:50 -0700
committerAShifter <[email protected]>2017-11-21 15:12:55 -0700
commit8ec044f8c9cab43ac10c86ce605264e351f3e237 (patch)
treee73e1abd121f3d944e3bd0953404a4c25987f754 /ShiftOS.Main/Terminal/Commands/Help.cs
parent2950e4546a0aad1036a7e655c41d170e6dd7ef12 (diff)
downloadshiftos-rewind-8ec044f8c9cab43ac10c86ce605264e351f3e237.tar.gz
shiftos-rewind-8ec044f8c9cab43ac10c86ce605264e351f3e237.tar.bz2
shiftos-rewind-8ec044f8c9cab43ac10c86ce605264e351f3e237.zip
Improved help and added SFTP
let's see if this works
Diffstat (limited to 'ShiftOS.Main/Terminal/Commands/Help.cs')
-rw-r--r--ShiftOS.Main/Terminal/Commands/Help.cs31
1 files changed, 27 insertions, 4 deletions
diff --git a/ShiftOS.Main/Terminal/Commands/Help.cs b/ShiftOS.Main/Terminal/Commands/Help.cs
index 9a9e415..248623e 100644
--- a/ShiftOS.Main/Terminal/Commands/Help.cs
+++ b/ShiftOS.Main/Terminal/Commands/Help.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}");
+ }
}
}
}