X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=doc%2Fmanual%2Fprimer%2Fcommands.txt;h=5f89d506253c07ffaab94c137d4714f9a5b186a9;hp=6169734982c95836b91dcc280dae3832eb5a1ac1;hb=ae710059291ba9830a9b20d899bdef6a5122dd73;hpb=b800eb0336a190ed53da90a2b7216a35bfbfdb23 diff --git a/doc/manual/primer/commands.txt b/doc/manual/primer/commands.txt index 6169734982..5f89d50625 100644 --- a/doc/manual/primer/commands.txt +++ b/doc/manual/primer/commands.txt @@ -68,9 +68,9 @@ static const struct command_registration hello_command_handlers[] = { { .name = "hello", .mode = COMMAND_ANY, - .handler = &handle_hello_command, - .help = "print a warm greetings", - .usage = "[]", + .handler = handle_hello_command, + .help = "print a warm greeting", + .usage = "[name]", }, { .chain = foo_command_handlers, @@ -84,7 +84,12 @@ int hello_register_commands(struct command_context_s *cmd_ctx) } @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