+ const char *startup = openocd_startup_tcl;
+ struct command_context *cmd_ctx = command_init(startup, interp);
+
+ /* register subsystem commands */
+ typedef int (*command_registrant_t)(struct command_context *cmd_ctx);
+ static const command_registrant_t command_registrants[] = {
+ &openocd_register_commands,
+ &server_register_commands,
+ &gdb_register_commands,
+ &log_register_commands,
+ &transport_register_commands,
+ &interface_register_commands,
+ &target_register_commands,
+ &flash_register_commands,
+ &nand_register_commands,
+ &pld_register_commands,
+ &mflash_register_commands,
+ NULL
+ };
+ for (unsigned i = 0; NULL != command_registrants[i]; i++)
+ {
+ int retval = (*command_registrants[i])(cmd_ctx);
+ if (ERROR_OK != retval)
+ {
+ command_done(cmd_ctx);
+ return NULL;
+ }
+ }
+ LOG_DEBUG("command registration: complete");
+
+ LOG_OUTPUT(OPENOCD_VERSION "\n"
+ "Licensed under GNU GPL v2\n");