How do I get the instance of the struct for the determined command? #356
-
I've spent many hours scouring the documentation, examples, Googleing, ChatGPTing, debuggering to exam runtime values, and looking at source code but I can't seem to find this answer. Given
After parsing:
I can get the command text:
then I can do a switch on that:
If in my arrangement, I know that every command implements some interface, and I want to call that for any command called. Is there a way to just get the command struct that's been resolved by the command line?
Any guidance would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
First off, I appreciate that you've really tried to figure it out yourself. Thank you. You can use |
Beta Was this translation helpful? Give feedback.
First off, I appreciate that you've really tried to figure it out yourself. Thank you.
You can use
kong.Context.Selected()
for this. Here's an example.