scandum / tintin

TinTin++, aka tt++, is an extensible console MUD client.
https://tintin.mudhalla.net
GNU General Public License v3.0
204 stars 56 forks source link

Echo the unknown option with #list invalid syntax errors #235

Open rigrig opened 2 weeks ago

rigrig commented 2 weeks ago

It would be nice if the error tells you which unknown option is being called.

I was using #list $var swap on a recent tt++ version, but someone pointed out that my scripts gave a bunch of errors on older tt++ versions (2.02.20), the error message was something like

################################# LIST OPTIONS #################################
  [ADD                     ] Add items to a list
  [CLEAR                   ] Clear a list
  [COLLAPSE                ] Collapse the list into a variable
  [COPY                    ] Copy a list to a list
  [CREATE                  ] Create a list with given items
  [DELETE                  ] Delete a list item with given index
  [EXPLODE                 ] Explode the variable into a list
  [FILTER                  ] Filter a list with given regex
  [FIND                    ] Find a list item with given regex
  [GET                     ] Retrieve a list item with given index
  [INDEXATE                ] Indexate a list table for sorting
  [INSERT                  ] Insert an item at given index
  [ORDER                   ] Sort a list table numerically
  [REFINE                  ] Filter a list with given math
  [REVERSE                 ] Sort a list table in reverse order
  [SET                     ] Change a list item at given index
  [SHUFFLE                 ] Sort a list table in random order
  [SIMPLIFY                ] Turn a list table into a simple list
  [SORT                    ] Sort a list table alphabetically
  [TOKENIZE                ] Create a list with given characters
################################################################################

I had to bisect my script and look at recent tt++ changes before realizing what I was doing wrong :p

scandum commented 2 weeks ago

Thanks for letting me know. I'll fix that for the next release, as well as a few other commands that do the same thing.