From: openocd-gerrit <ope...@us...> - 2025-05-09 12:12:33
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 8c09cc2c17547dca9783b596d43b735520f2e936 (commit) from d6c54b94941294628c5ebff5f9c776c4a7b2aebb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8c09cc2c17547dca9783b596d43b735520f2e936 Author: Evgeniy Naydanov <evg...@sy...> Date: Mon Apr 28 16:46:08 2025 +0300 target: improve error messaging in `target create` There are a couple of issues with the usage string for `target create`, namely: * `-chain-position` is allowed to be not the first option. * `-chain-position` should be ommited alltogether on ARM targets when DAP is specified. Before the patch: ``` > openocd -c 'target create name testee' ... target create name type '-chain-position' name [options ...] ``` After the patch: ``` > openocd -c 'target create name testee' ... -chain-position ?name? required when creating target > openocd -c 'target create' ... target create name type [options ...] ``` Change-Id: Ia21a99ce6a4086e2e0676f5ef4685da3514a4f69 Signed-off-by: Evgeniy Naydanov <evg...@sy...> Reviewed-on: https://review.openocd.org/c/openocd/+/8860 Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Tomas Vanek <va...@fb...> Tested-by: jenkins diff --git a/src/target/target.c b/src/target/target.c index a85d3def8..6d2fc9506 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -5706,7 +5706,7 @@ COMMAND_HANDLER(handle_target_create) int retval = ERROR_OK; int x; - if (CMD_ARGC < 4) + if (CMD_ARGC < 2) return ERROR_COMMAND_SYNTAX_ERROR; /* check if the target name clashes with an existing command name */ @@ -6051,7 +6051,7 @@ static const struct command_registration target_subcommand_handlers[] = { .name = "create", .mode = COMMAND_CONFIG, .handler = handle_target_create, - .usage = "name type '-chain-position' name [options ...]", + .usage = "name type [options ...]", .help = "Creates and selects a new target", }, { ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |