df-mc/dragonfly

Show useful message such as command description, usage, etc when insufficient arguments given

Opened this issue · 0 comments

// ErrInsufficientArgs is returned by argument parsing functions if it does not have sufficient arguments
// passed and is not optional.
var ErrInsufficientArgs = errors.New("not enough arguments for command")

Current DF shows the above message if insufficient arguments are given by a player.

Rather than sending messages like that, showing a usage, description provided by command would definitely be better for a player.

Perhaps having the following and sending this would be good:

func (*c MyCommand) Help() []string {
    return []string{
        "/mycmd a",
        "/mycmd b",
        "/mycmd c",
    }
}