X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fopenocd.c;h=623bd0c1625d0403e2ef294d25fe4ba31993f6b2;hp=d376f5f8e1b1b5923419a9466349e931be483013;hb=bc7fa896e69d5a325776da4e5b423940cb1124dd;hpb=c25fda2c95f130d758c7784277fe5f2693ff3dd4 diff --git a/src/openocd.c b/src/openocd.c index d376f5f8e1..623bd0c162 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -159,6 +159,16 @@ COMMAND_HANDLER(handle_init_command) return ERROR_OK; } +COMMAND_HANDLER(handle_add_script_search_dir_command) +{ + if (CMD_ARGC != 1) + return ERROR_COMMAND_SYNTAX_ERROR; + + add_script_search_dir(CMD_ARGV[0]); + + return ERROR_OK; +} + static const struct command_registration openocd_command_handlers[] = { { .name = "version", @@ -181,11 +191,18 @@ static const struct command_registration openocd_command_handlers[] = { "Unless 'noinit' is called, this command is " "called automatically at the end of startup.", + }, + { + .name = "add_script_search_dir", + .handler = &handle_add_script_search_dir_command, + .mode = COMMAND_ANY, + .help = "dir to search for config files and scripts", + }, COMMAND_REGISTRATION_DONE }; -int openocd_register_commands(struct command_context *cmd_ctx) +static int openocd_register_commands(struct command_context *cmd_ctx) { return register_commands(cmd_ctx, NULL, openocd_command_handlers); } @@ -193,7 +210,7 @@ int openocd_register_commands(struct command_context *cmd_ctx) struct command_context *global_cmd_ctx; /* NB! this fn can be invoked outside this file for non PC hosted builds */ -struct command_context *setup_command_handler(Jim_Interp *interp) +static struct command_context *setup_command_handler(Jim_Interp *interp) { log_init(); LOG_DEBUG("log_init: complete");