@endcode
Of course, you may also call other macros or functions, but that extends
-beyond the scope of this tutorial on writing commands.
+beyond the scope of this tutorial on writing commands.
@section primercmdreg Command Registration
{
.name = "hello",
.mode = COMMAND_ANY,
- .handler = &handle_hello_command,
- .help = "print a warm greetings",
- .usage = "[<name>]",
+ .handler = handle_hello_command,
+ .help = "print a warm greeting",
+ .usage = "[name]",
},
{
.chain = foo_command_handlers,
}
@endcode
-That's it! The command should now be registered and avaiable to scripts.
+Note that the "usage" text should use the same EBNF that's found
+in the User's Guide: literals in 'single quotes', sequences of
+optional parameters in [square brackets], and alternatives in
+(parentheses|with|vertical bars), and so forth. No angle brackets.
+
+That's it! The command should now be registered and available to scripts.
@section primercmdchain Command Chaining