X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fhello.c;h=dd33650dcf004272e6a969b61e31dd866f3584b5;hp=267cc28e4eda264c8f1e33c489104930dcc2def8;hb=2861877b32a7a2f4022a1c3d9b66c9b4879878ac;hpb=98723c4ecdbe06f90c66f3abec27b792c3b38e34 diff --git a/src/hello.c b/src/hello.c index 267cc28e4e..dd33650dcf 100644 --- a/src/hello.c +++ b/src/hello.c @@ -24,15 +24,15 @@ static COMMAND_HELPER(handle_hello_args, const char **sep, const char **name) { - if (argc > 1) + if (CMD_ARGC > 1) { LOG_ERROR("%s: too many arguments", CMD_NAME); return ERROR_COMMAND_SYNTAX_ERROR; } - if (1 == argc) + if (1 == CMD_ARGC) { *sep = " "; - *name = args[0]; + *name = CMD_ARGV[0]; } else *sep = *name = ""; @@ -44,13 +44,13 @@ COMMAND_HANDLER(handle_hello_command) const char *sep, *name; int retval = CALL_COMMAND_HANDLER(handle_hello_args, &sep, &name); if (ERROR_OK == retval) - command_print(cmd_ctx, "Greetings%s%s!", sep, name); + command_print(CMD_CTX, "Greetings%s%s!", sep, name); return retval; } int hello_register_commands(struct command_context *cmd_ctx) { - struct command_s *cmd = register_command(cmd_ctx, NULL, "hello", + struct command *cmd = register_command(cmd_ctx, NULL, "hello", &handle_hello_command, COMMAND_ANY, "option"); return cmd ? ERROR_OK : -ENOMEM;