diff --git a/BuildTime.txt b/BuildTime.txt index 621a720..f2b33e9 100644 --- a/BuildTime.txt +++ b/BuildTime.txt @@ -1 +1 @@ -2026-02-27 22:33:00 \ No newline at end of file +2026-02-27 22:39:48 \ No newline at end of file diff --git a/GitCommit.txt b/GitCommit.txt index 81c28ba..4b426de 100644 --- a/GitCommit.txt +++ b/GitCommit.txt @@ -1 +1 @@ -fefb7e7 \ No newline at end of file +b67e0e7 \ No newline at end of file diff --git a/shell/Commands/Help/Help.cs b/shell/Commands/Help/Help.cs index c7c9f28..18e23a0 100644 --- a/shell/Commands/Help/Help.cs +++ b/shell/Commands/Help/Help.cs @@ -403,7 +403,7 @@ namespace CMLeonOS.Commands { Command = "help", Parameters = "", - Description = "Show help page (1-3)", + Description = "Show help page (1-4)", SubCommands = new[] { new SubCommandInfo { Command = "help all", Description = "Show all help pages" } } } }; @@ -483,24 +483,32 @@ namespace CMLeonOS.Commands pageNumber = 1; } - int startIndex = (pageNumber - 1) * CommandsPerPage; - int endIndex = Math.Min(startIndex + CommandsPerPage, allCommands.Count); - Console.WriteLine("===================================="); Console.WriteLine($" Help - Page {pageNumber}/{totalPages}"); Console.WriteLine("===================================="); Console.WriteLine(); int linesOnPage = 0; - for (int i = startIndex; i < endIndex; i++) + int currentLine = 0; + + for (int i = 0; i < allCommands.Count; i++) { int cmdLines = GetCommandLinesCount(allCommands[i]); - if (linesOnPage + cmdLines > CommandsPerPage) + + if (currentLine + cmdLines <= (pageNumber - 1) * CommandsPerPage) + { + currentLine += cmdLines; + continue; + } + + if (linesOnPage >= CommandsPerPage) { break; } + DisplayCommand(allCommands[i]); linesOnPage += cmdLines; + currentLine += cmdLines; } if (pageNumber < totalPages)