fix: refuse a mistyped --target in cross_reference

load_target_config raised out of cross_reference.py as a traceback. The hint now names the full verify.py command, since cross_reference and slots have no --list-targets.
This commit is contained in:
Abdessamad Derraz committed 2026-10-21 10:00:47 +02:00
1 parent 8ed1a737a8
commit 7b9c8ae663
3 files changed
+33 -6

No files matched your search

+4 -1
View File
@@ -658,8 +658,11 @@ def load_target_config(
# through, where a platform or emulator name gets the closest ones.
raise ValueError(
f"Unknown target '{target}' for platform '{platform_name}'.\n"
# Named as a full command: cross_reference.py and slots.py take
# --target but have no --list-targets of their own.
+ suggest_names(
[target], sorted(alias_index), "--list-targets", len(targets)
[target], sorted(alias_index),
f"verify.py --platform {platform_name} --list-targets", len(targets),
)
)
+10 -5
View File
@@ -979,11 +979,16 @@ def main() -> None:
if args.platform:
from common import load_target_config, resolve_platform_cores
target_cores = (
load_target_config(args.platform, args.target, args.platforms_dir)
if args.target
else None
)
try:
target_cores = (
load_target_config(args.platform, args.target, args.platforms_dir)
if args.target
else None
)
except (FileNotFoundError, ValueError) as exc:
# A typo ended in a traceback where verify and slots name the
# closest target.
parser.error(str(exc))
config = load_platform_config(args.platform, args.platforms_dir)
relevant = resolve_platform_cores(config, profiles, target_cores=target_cores)
run_anywhere = (