| Age | Commit message (Collapse) | Author |
|
Idiomatic Go uses struct{} for zero-allocation sets. Two locations:
- GetCompletionTopics: seen deduplication map
- init(): seenCat category deduplication map
|
|
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
|
|
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.
|
|
'help <TAB>' was suggesting 'help help'. Skip 'help' itself
in GetCompletionTopics so tab completion offers actual topics.
|
|
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
|