mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-07 15:56:31 +02:00
Replace halt command with shutdown and add new reboot command
This commit is contained in:
@@ -19,7 +19,8 @@ public class Kernel : Sys.Kernel
|
|||||||
CommandManager.RegisterCommands([
|
CommandManager.RegisterCommands([
|
||||||
new HelpCommand(),
|
new HelpCommand(),
|
||||||
new ClearCommand(),
|
new ClearCommand(),
|
||||||
new HaltCommand(),
|
new ShutdownCommand(),
|
||||||
|
new RebootCommand(),
|
||||||
new SpawnProcessCommand(),
|
new SpawnProcessCommand(),
|
||||||
new ListProcessesCommand(),
|
new ListProcessesCommand(),
|
||||||
new StopProcessCommand(),
|
new StopProcessCommand(),
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
namespace RemSox.UI.CLI.Commands;
|
namespace RemSox.UI.CLI.Commands;
|
||||||
|
|
||||||
public sealed class HaltCommand : ICommand
|
public sealed class ShutdownCommand : ICommand
|
||||||
{
|
{
|
||||||
public string Name => "halt";
|
public string Name => "shutdown";
|
||||||
|
|
||||||
public string Description => "Halt the system";
|
public string Description => "Shutdown the system";
|
||||||
|
|
||||||
public void Execute(string? arguments, Action<string> printLine)
|
public void Execute(string? arguments, Action<string> printLine)
|
||||||
{
|
{
|
||||||
printLine("Halting system...");
|
printLine("Shutting down system...");
|
||||||
Environment.Exit(0);
|
Sys.Power.Shutdown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
namespace RemSox.UI.CLI.Commands;
|
||||||
|
|
||||||
|
public class RebootCommand : ICommand
|
||||||
|
{
|
||||||
|
public string Name => "reboot";
|
||||||
|
|
||||||
|
public string Description => "Reboot the system";
|
||||||
|
|
||||||
|
public void Execute(string? arguments, Action<string> printLine)
|
||||||
|
{
|
||||||
|
printLine("Rebooting system...");
|
||||||
|
Sys.Power.Reboot();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user