diff --git a/src/tui/commands.cpp b/src/tui/commands.cpp index 1d47862..51a69ae 100644 --- a/src/tui/commands.cpp +++ b/src/tui/commands.cpp @@ -27,9 +27,28 @@ void Tui::RegisterCommands() { {{"command name (optional)", Completion::Command}}, [this](const std::vector &args) { if (args.empty()) { - // Bare → open the feature-reference screen. - screen_back_idx = -1; - screen_idx = 6; + // Bare → textual list of commands. The feature-reference + // screen lives at `screen_idx = 6` and is reachable from + // the dashboard with `[h]`. + size_t maxw = 0; + for (const auto &kv : commands) maxw = std::max(maxw, kv.first.size()); + auto print_group = [&](const std::string &title, bool want_interactive) { + bool printed_any = false; + for (const auto &kv : commands) { + if (kv.second.hidden) continue; + if (kv.second.interactive != want_interactive) continue; + if (!printed_any) { Print(title); printed_any = true; } + Print(" " + kv.first + + std::string(maxw - kv.first.size() + 2, ' ') + + kv.second.description); + } + }; + Print("Commands — type `help ` for details."); + print_group("Interactive (open a full-screen mode):", true); + print_group("Other:", false); + Print("Keys: Esc cancels a multi-step prompt or returns to the dashboard;"); + Print(" Tab completes commands/paths or cycles focus in screens;"); + Print(" PageUp/PageDown scroll output, Home/End jump to top/bottom."); return; } const std::string &name = args[0]; @@ -55,9 +74,7 @@ void Tui::RegisterCommands() { } }, /*prompt_for_missing=*/ false, - "bare → open the help screen; `help ` → textual command help", - /*scriptable=*/ false, - /*interactive=*/ true, + "list commands (or `help ` for one command's details)", }; commands["clear"] = { {}, [this](auto &) { output.clear(); }, true, "clear the visualization area" }; @@ -571,8 +588,11 @@ void Tui::RegisterCommands() { }; // UI alias: the dashboard surfaces this command as `plug`. Keep the // canonical `connect` for script + save/restore stability. + // `plug` is the user-facing name (dashboard shortcut [p]). `connect` + // stays registered for script + save/restore backward compatibility but + // is hidden from `help`. commands["plug"] = commands["connect"]; - commands["plug"].description = "alias of `connect` (UI label used in the dashboard)"; + commands["connect"].hidden = true; commands["explore"] = { {}, [this](auto &) { if (!sys) { Print("no system: run 'new' first."); return; } diff --git a/src/tui/tui.hpp b/src/tui/tui.hpp index 60c754e..e59a71d 100644 --- a/src/tui/tui.hpp +++ b/src/tui/tui.hpp @@ -35,6 +35,7 @@ class Tui { std::string description; bool scriptable = true; bool interactive = false; ///< opens a full-screen mode when called bare + bool hidden = false; ///< don't list in `help` (used by aliases) }; // ---- Shell state ----