-static int etb_register_commands(struct command_context_s *cmd_ctx)
-{
- command_t *etb_cmd = register_command(cmd_ctx, NULL, "etb",
- NULL, COMMAND_ANY, "Embedded Trace Buffer");
-
- register_command(cmd_ctx, etb_cmd, "config",
- handle_etb_config_command, COMMAND_CONFIG,
- NULL);
-
- return ERROR_OK;
-}
+static const struct command_registration etb_config_command_handlers[] = {
+ {
+ .name = "config",
+ .handler = &handle_etb_config_command,
+ .mode = COMMAND_CONFIG,
+ .usage = "<target> <tap>",
+ },
+ COMMAND_REGISTRATION_DONE
+};
+static const struct command_registration etb_command_handlers[] = {
+ {
+ .name = "etb",
+ .mode = COMMAND_ANY,
+ .help = "Emebdded Trace Buffer command group",
+ .chain = etb_config_command_handlers,
+ },
+ COMMAND_REGISTRATION_DONE
+};