summaryrefslogtreecommitdiff
path: root/internal/repl/help.go
AgeCommit message (Collapse)Author
2026-05-25style(repl): use map[string]struct{} for sets instead of map[string]boolPaul Buetow
Idiomatic Go uses struct{} for zero-allocation sets. Two locations: - GetCompletionTopics: seen deduplication map - init(): seenCat category deduplication map
2026-05-25refactor(repl): register 'categories' as HelpTopic with custom RenderPaul Buetow
Add a Render func() string field to HelpTopic that overrides the default formatTopic rendering. Use it to register 'categories' as a normal HelpTopic entry instead of a hardcoded if-branch in GetHelp. - Remove hardcoded if topic == "categories" from GetHelp - Remove hardcoded 'categories' from GetCompletionTopics - Remove dead getCategoriesHelp function from help.go - 'categories' now discovered through normal helpByTopic lookup
2026-05-25refactor(repl): split help.go into data (help_topics.go) and logic (help.go)Paul Buetow
The original help.go was 657 lines mixing data, indexing, and lookup logic. Split into: - help_topics.go (489 lines): HelpTopic struct, helpTopics data slice, index variables, and init() that builds the lookup maps. - help.go (171 lines): GetHelp, GetAllTopics, GetCompletionTopics, getGeneralHelp, getCategoriesHelp, and formatTopic. All tests pass. No behavioral changes.
2026-05-25fix: exclude 'help' from help topic completionsPaul Buetow
'help <TAB>' was suggesting 'help help'. Skip 'help' itself in GetCompletionTopics so tab completion offers actual topics.
2026-05-25feat: inline help system with per-operator topics and auto-completionPaul Buetow
Replace the old static help text with a data-driven help system that provides one help entry per operator, function, or REPL command, each with category, description, usage, and examples. - help.go: 35+ help topics covering all operators (arithmetic, comparison, stack, hyper, variables, constants, REPL commands) - GetHelp(topic) returns formatted help; GetHelp("") returns overview - help categories lists all topics grouped by category - Aliases supported (e.g. help gt shows help for > operator) - Auto-completion for help topics when typing 'help <TAB>' - REPL entries take priority in helpByTopic (e.g. 'help clear' shows screen clear, not RPN variable clear) - Comprehensive tests for all public functions