Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alvin0319 opened this issue May 30, 2023 · 0 comments
Labels
improvement Improvement of an existing part of the codebase

Comments

@alvin0319
Copy link
Contributor

// 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",
    }
}
@Sandertv Sandertv added the improvement Improvement of an existing part of the codebase label Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement of an existing part of the codebase
Projects
None yet
Development

No branches or pull requests

2 participants