added support for Tcl config scripts on the command line(use .tcl extension).
git-svn-id: svn://svn.berlios.de/openocd/trunk@743 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
@@ -79,9 +79,19 @@ int parse_cmdline_args(struct command_context_s *cmd_ctx, int argc, char *argv[]
|
||||
version_flag = 1;
|
||||
break;
|
||||
case 'f': /* --file | -f */
|
||||
snprintf(command_buffer, 128, "script %s", optarg);
|
||||
add_config_file_name(command_buffer);
|
||||
{
|
||||
char *t=strrchr(optarg, '.');
|
||||
if (strcmp(t, ".tcl")==0)
|
||||
{
|
||||
/* Files ending in .tcl are executed as Tcl files */
|
||||
snprintf(command_buffer, 128, "source [find {%s}]", optarg);
|
||||
} else
|
||||
{
|
||||
snprintf(command_buffer, 128, "script %s", optarg);
|
||||
}
|
||||
add_config_command(command_buffer);
|
||||
break;
|
||||
}
|
||||
case 's': /* --search | -s */
|
||||
add_script_search_dir(optarg);
|
||||
break;
|
||||
@@ -102,7 +112,7 @@ int parse_cmdline_args(struct command_context_s *cmd_ctx, int argc, char *argv[]
|
||||
case 'c': /* --command | -c */
|
||||
if (optarg)
|
||||
{
|
||||
add_config_file_name(optarg);
|
||||
add_config_command(optarg);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user