Feature Provide command usage examples in text title

Irrat

Member
Most of the commands that can be used are obvious enough, but a few of them are a bit confusing. The syntax may be complicated and there may be edge cases out there.

My suggestion, now that you can hover over text in CLI to show a floating "title" is that we can use it to show examples of how the commands should be used.

1644554537139.png

Unfortunately I don't believe we can use new lines in the title text, unless another change is made somewhere. Not a big deal though, just means we can't cram it full of information.

So an example here, is the SendMessageCommand.
Usage is shown as
Code:
<item> [, <item>]... to <recipient> [ || <message> ] - send kmail
Seems simple enough?

Not really.

It might be easy enough if you're familiar with it, but I find it a bit confusing on how to use it. I'm still not sure if I'm even using it the right way or I just somehow stumbled on something that shouldn't have worked. Of course, playing with it familiarizes myself with it. But I shouldn't be confused to begin with. It's not a difficult concept.

So when we now hover over the command when the usage is printed out, it may show an example usage
Code:
kmail big rock ¶ 2, 1959, 500 meat to recipientname || Here's two big rocks and a tattered scrap of paper (Written using item id), 500 meat as well! Also you're getting this message!

This suggestion is mostly aimed at those commands that can accept dynamic/optional parameters.

Thinking about it further, this specific example could be changed by instead pointing at another guide on writing item lists in CLI
 
You could document these functions with examples as java docs to the command classes if you like.
 
Back
Top