summaryrefslogtreecommitdiff
path: root/internal/repl/commands.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-23 22:30:42 +0200
committerPaul Buetow <paul@buetow.org>2026-03-23 22:30:42 +0200
commit6eaa71ba0d7c0b56853860c2f1eb43096dd928e7 (patch)
treef328cb2bc31dca6524d8bf78c6c4e43d1ffb3cb0 /internal/repl/commands.go
parentbd4750a4094ba8c6cddb6559e4599df2c068ced9 (diff)
Replace global variable with function in internal/repl
Diffstat (limited to 'internal/repl/commands.go')
-rw-r--r--internal/repl/commands.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/repl/commands.go b/internal/repl/commands.go
index d03672e..2f3a942 100644
--- a/internal/repl/commands.go
+++ b/internal/repl/commands.go
@@ -6,11 +6,13 @@ import (
)
// builtinCommands defines the built-in REPL commands
-var builtinCommands = []string{"help", "clear", "quit", "exit", "rpn", "calc"}
+func builtinCommands() []string {
+ return []string{"help", "clear", "quit", "exit", "rpn", "calc"}
+}
// Commands returns the list of built-in command names supported by the REPL.
func Commands() []string {
- return builtinCommands
+ return builtinCommands()
}
// ExecuteCommand runs a built-in command and returns its output or error