diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-23 22:30:42 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-23 22:30:42 +0200 |
| commit | 6eaa71ba0d7c0b56853860c2f1eb43096dd928e7 (patch) | |
| tree | f328cb2bc31dca6524d8bf78c6c4e43d1ffb3cb0 /internal/repl/commands.go | |
| parent | bd4750a4094ba8c6cddb6559e4599df2c068ced9 (diff) | |
Replace global variable with function in internal/repl
Diffstat (limited to 'internal/repl/commands.go')
| -rw-r--r-- | internal/repl/commands.go | 6 |
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 |
