X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fhello.c;h=d3fce3dc58821b23a2046b3b9dcf51305244b4c4;hp=9a1bf92520349366206ae43f43c8e41ce717a9c1;hb=23bf724e048df62181e744245af42d3694989749;hpb=16e0404777581e55bb42b95f5c9208b2c411debe diff --git a/src/hello.c b/src/hello.c index 9a1bf92520..d3fce3dc58 100644 --- a/src/hello.c +++ b/src/hello.c @@ -20,7 +20,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include "log.h" +#include COMMAND_HANDLER(handle_foo_command) { @@ -58,19 +58,22 @@ static const struct command_registration foo_command_handlers[] = { .name = "bar", .handler = &handle_foo_command, .mode = COMMAND_ANY, - .help = "
[enable|disable] - an example command", + .usage = "address ['enable'|'disable']", + .help = "an example command", }, { .name = "baz", .handler = &handle_foo_command, .mode = COMMAND_ANY, - .help = "
[enable|disable] - a sample command", + .usage = "address ['enable'|'disable']", + .help = "a sample command", }, { .name = "flag", .handler = &handle_flag_command, .mode = COMMAND_ANY, - .help = "[on|off] - set a flag", + .usage = "[on|off]", + .help = "set a flag", }, COMMAND_REGISTRATION_DONE }; @@ -101,13 +104,13 @@ COMMAND_HANDLER(handle_hello_command) return retval; } -static const struct command_registration hello_command_handlers[] = { +const struct command_registration hello_command_handlers[] = { { .name = "hello", - .handler = &handle_hello_command, + .handler = handle_hello_command, .mode = COMMAND_ANY, .help = "prints a warm welcome", - .usage = "[]", + .usage = "[name]", }, { .name = "foo", @@ -118,8 +121,3 @@ static const struct command_registration hello_command_handlers[] = { }, COMMAND_REGISTRATION_DONE }; - -int hello_register_commands(struct command_context *cmd_ctx) -{ - return register_commands(cmd_ctx, NULL, hello_command_handlers); -}