1
7
Fork
You've already forked debugger.lua
0

[UX Suggestion] Add "command not found" error message? #69

Closed
opened 2020年05月05日 13:02:01 +02:00 by vyder · 0 comments
vyder commented 2020年05月05日 13:02:01 +02:00 (Migrated from github.com)
Copy link

I come from a Ruby background and am used to pry and byebug as my main debuggers, and spent a good 20mins wondering why I couldn't inspect variables with this debugger when stepping/moving worked fine.

I was doing variations of this:

debugger.lua> transitions
debugger.lua> src_state
debugger.lua> print src_state
debugger.lua> locals
debugger.lua> l
	dest_state => "Ready"
	src_state => "Not Ready"
	transitions => {"Not Ready" = {}}

I realize that l prints all the locals out, but I'm wondering how I can inspect individual variables...

And then out of frustration I type in:

debugger.lua> asdfasdf
debugger.lua>

And notice that the prompt doesn't react and then I'm like ohhh when it doesn't understand a command it just pretends like nothing happened.

Cue these attempts:

debugger.lua> pp(transitions)
debugger.lua> p
Error: command 'p' not recognized.
Type 'h' and press return for a command list.
debugger.lua> pp
debugger.lua> h
[.. help output ..]
debugger.lua> p transitions
transitions => {"Not Ready" = {}}

I was expecting the output of p and pp to tell me what arguments they were expecting.

Even more confusing is that when you do type in the right single character command but with the wrong arguments, it says Error: command 'p' not recognized - which is arguably even more misleading 🤣

Anyway. Just throwing my 2 cents in here. (削除) I'm still too much of a lua noob to attempt to fix this myself, but if you think it's a worthy addition, I can make an attempt. (削除ここまで)

Edit: Turned out to be an easy fix - I created a PR.

I come from a Ruby background and am used to [`pry`](https://github.com/pry/pry) and [`byebug`](https://github.com/deivid-rodriguez/byebug) as my main debuggers, and spent a good 20mins wondering why I couldn't inspect variables with this debugger when stepping/moving worked fine. I was doing variations of this: ``` debugger.lua> transitions debugger.lua> src_state debugger.lua> print src_state debugger.lua> locals debugger.lua> l dest_state => "Ready" src_state => "Not Ready" transitions => {"Not Ready" = {}} ``` I realize that `l` prints all the locals out, but I'm wondering how I can inspect individual variables... And then out of frustration I type in: ``` debugger.lua> asdfasdf debugger.lua> ``` And notice that the prompt doesn't react and then I'm like ohhh when it doesn't understand a command it just pretends like nothing happened. Cue these attempts: ``` debugger.lua> pp(transitions) debugger.lua> p Error: command 'p' not recognized. Type 'h' and press return for a command list. debugger.lua> pp debugger.lua> h [.. help output ..] debugger.lua> p transitions transitions => {"Not Ready" = {}} ``` I was expecting the output of `p` and `pp` to tell me what arguments they were expecting. Even more confusing is that when you do type in the right single character command but with the wrong arguments, it says `Error: command 'p' not recognized` - which is arguably even more misleading 🤣 Anyway. Just throwing my 2 cents in here. ~I'm still too much of a lua noob to attempt to fix this myself, but if you think it's a worthy addition, I can make an attempt.~ Edit: Turned out to be an easy fix - I created a PR.
Sign in to join this conversation.
No Branch/Tag specified
master
no-extras
dev
patch-1
media
simple-term
slembcke
error-hook
standalone
No results found.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
slembcke/debugger.lua#69
Reference in a new issue
slembcke/debugger.lua
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?