]> www.infradead.org Git - users/borneoa/openocd-next.git/commit
target: improve error messaging in `target create`
authorEvgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Mon, 28 Apr 2025 13:46:08 +0000 (16:46 +0300)
committerAntonio Borneo <borneo.antonio@gmail.com>
Fri, 9 May 2025 12:12:04 +0000 (12:12 +0000)
commit8c09cc2c17547dca9783b596d43b735520f2e936
tree44eedf48261115689e525f3c130ad46a3773158d
parentd6c54b94941294628c5ebff5f9c776c4a7b2aebb
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 <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8860
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
src/target/target.c