diff --git a/Kernel.cs b/Kernel.cs index 813e3d3..cd751ca 100644 --- a/Kernel.cs +++ b/Kernel.cs @@ -19,7 +19,8 @@ public class Kernel : Sys.Kernel CommandManager.RegisterCommands([ new HelpCommand(), new ClearCommand(), - new HaltCommand(), + new ShutdownCommand(), + new RebootCommand(), new SpawnProcessCommand(), new ListProcessesCommand(), new StopProcessCommand(), diff --git a/UI/CLI/Commands/HaltCommand.cs b/UI/CLI/Commands/HaltCommand.cs index 0e212e6..a207b46 100644 --- a/UI/CLI/Commands/HaltCommand.cs +++ b/UI/CLI/Commands/HaltCommand.cs @@ -1,14 +1,14 @@ 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 printLine) { - printLine("Halting system..."); - Environment.Exit(0); + printLine("Shutting down system..."); + Sys.Power.Shutdown(); } } \ No newline at end of file diff --git a/UI/CLI/Commands/RebootCommand.cs b/UI/CLI/Commands/RebootCommand.cs new file mode 100644 index 0000000..24542ac --- /dev/null +++ b/UI/CLI/Commands/RebootCommand.cs @@ -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 printLine) + { + printLine("Rebooting system..."); + Sys.Power.Reboot(); + } +}