summaryrefslogtreecommitdiff
path: root/internal/repl
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-24 00:10:17 +0300
committerPaul Buetow <paul@buetow.org>2026-05-24 00:10:17 +0300
commit066a65487a8937f1754b3daf246702fdbf9f3a5c (patch)
treed9828799233c6814d8ce4f1a5931ceb96702cd71 /internal/repl
parent1b793d701bce27a39e09db7c924af48b95c1f4a1 (diff)
fix(repl): correct misleading comments in commands.go
- Fix cmdStack doc comment: it redirects to 'rpn show' rather than displaying stack state directly (has no access to RPN state) - Add missing 'rat' and 'stack' to cmdHelp's fallback available commands list
Diffstat (limited to 'internal/repl')
-rw-r--r--internal/repl/commands.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/repl/commands.go b/internal/repl/commands.go
index 3f5a15e..5698478 100644
--- a/internal/repl/commands.go
+++ b/internal/repl/commands.go
@@ -117,7 +117,7 @@ Press Ctrl+D or type 'quit'/'exit' to exit.
case "quit", "exit":
return "quit / exit - Exit the REPL\nUsage: quit or exit"
default:
- return fmt.Sprintf("No help available for: %s\nAvailable commands: help, clear, quit, exit, rpn, calc", subCmd)
+ return fmt.Sprintf("No help available for: %s\nAvailable commands: help, clear, quit, exit, rpn, calc, rat, stack", subCmd)
}
}
@@ -140,10 +140,10 @@ func cmdQuit() error {
return nil
}
-// cmdStack displays the current RPN stack state.
-// It shows the stack depth and each value with its index.
+// cmdStack provides a hint for viewing the RPN stack.
+// It does not have access to RPN state; users should use 'rpn show' instead.
//
-// Returns the formatted stack output as a string
+// Returns a hint string directing users to the 'rpn show' command
func cmdStack() string {
return "Use 'rpn show' to view the current stack state"
}