From a2f203dd1a7a5110a3339da81e72da024be05ab5 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Thu, 19 Jan 2023 18:01:09 -0800 Subject: [PATCH] runners: restore obsolete synonyms for -i/--dev-id This is a partial revert of commit 2cee5ff5191e2f75995c8c91edec6ed8dcb22a8a ("scripts: west_commands: runners: remove deprecated options"). I remarked at the time that the removal of the older way of writing things from the runners themselves seemed gratuitous since they are easy to continue to support indefinitely and people may have been used to the old way of doing things. It didn't seem worth the fight to push for a revert at the time, though. Since then I've run into real problems that their removal has caused in the wild and I am convinced that this part of that patch was wrong. Restore the original, undeprecated forms of these options, but make it clear in the command line help that they're just obsolete alternative spellings at this point. Signed-off-by: Marti Bolivar --- scripts/west_commands/runners/jlink.py | 2 ++ scripts/west_commands/runners/nrfjprog.py | 2 ++ scripts/west_commands/runners/pyocd.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/scripts/west_commands/runners/jlink.py b/scripts/west_commands/runners/jlink.py index 8d595f29655..80b7de2dffb 100644 --- a/scripts/west_commands/runners/jlink.py +++ b/scripts/west_commands/runners/jlink.py @@ -94,6 +94,8 @@ class JLinkBinaryRunner(ZephyrBinaryRunner): # Optional: parser.add_argument('--loader', required=False, dest='loader', help='specifies a loader type') + parser.add_argument('--id', required=False, dest='dev_id', + help='obsolete synonym for -i/--dev-id') parser.add_argument('--iface', default='swd', help='interface to use, default is swd') parser.add_argument('--speed', default='auto', diff --git a/scripts/west_commands/runners/nrfjprog.py b/scripts/west_commands/runners/nrfjprog.py index 314711933dd..472cac3a20a 100644 --- a/scripts/west_commands/runners/nrfjprog.py +++ b/scripts/west_commands/runners/nrfjprog.py @@ -69,6 +69,8 @@ class NrfJprogBinaryRunner(ZephyrBinaryRunner): parser.add_argument('--softreset', required=False, action='store_true', help='use reset instead of pinreset') + parser.add_argument('--snr', required=False, dest='dev_id', + help='obsolete synonym for -i/--dev-id') parser.add_argument('--force', required=False, action='store_true', help='Flash even if the result cannot be guaranteed.') diff --git a/scripts/west_commands/runners/pyocd.py b/scripts/west_commands/runners/pyocd.py index 0903be64aea..793da476320 100644 --- a/scripts/west_commands/runners/pyocd.py +++ b/scripts/west_commands/runners/pyocd.py @@ -107,6 +107,8 @@ class PyOcdBinaryRunner(ZephyrBinaryRunner): DEFAULT_PYOCD_TELNET_PORT)) parser.add_argument('--tui', default=False, action='store_true', help='if given, GDB uses -tui') + parser.add_argument('--board-id', dest='dev_id', + help='obsolete synonym for -i/--dev-id') @classmethod def tool_opt_help(cls) -> str: