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

Usage #7

Open
z3t0 opened this issue Apr 12, 2015 · 2 comments
Open

Usage #7

z3t0 opened this issue Apr 12, 2015 · 2 comments

Comments

@z3t0
Copy link

z3t0 commented Apr 12, 2015

I am trying to figure out how to register a command.

commands.registerCommand(name, handler, usage, help);

name: What is this used for?
handler: I am guessing this is what the command is called, example please.
usage: What does this do?
help: What does this do?

@deathcap
Copy link
Member

This would be good to document in the readme, but..

Name is the command name, as the user types after a period (so "foo" is typed .foo). Handler is the callback used to execute the command, it is invoked with the command arguments if any, examples in https://github.com/deathcap/voxel-commands/blob/master/commands.coffee#L56. Usage is a string describing the syntax to the user -- arguments needed and what they are for, help is a short description of what the command does (both of these are used to display the .help command).

@z3t0
Copy link
Author

z3t0 commented Apr 17, 2015

@deathcap Thanks for the info, I'll definitely add it to the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants