From 8ccc84dd15628ca3c7b948d41dac541fe108b986 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Fri, 24 Jan 2025 12:37:07 -0300 Subject: [PATCH] Fix "unrecognized YAML option" error if `disassemble_all` is provided via CLI and as a YAML option. (#438) --- src/splat/util/options.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/splat/util/options.py b/src/splat/util/options.py index 8af16029..d1b8e548 100644 --- a/src/splat/util/options.py +++ b/src/splat/util/options.py @@ -554,10 +554,10 @@ def parse_endianness() -> Literal["big", "little"]: detect_redundant_function_end=p.parse_opt( "detect_redundant_function_end", bool, True ), - # Command line argument takes precedence over yaml option - disassemble_all=( - disasm_all if disasm_all else p.parse_opt("disassemble_all", bool, False) - ), + # Setting either option will produce a full disassembly, + # but we still have to check the yaml option first to avoid leaving option unparsed, + # because splat would complain about an unrecognized yaml option otherwise. + disassemble_all=p.parse_opt("disassemble_all", bool, False) or disasm_all, global_vram_start=p.parse_optional_opt("global_vram_start", int), global_vram_end=p.parse_optional_opt("global_vram_end", int), use_gp_rel_macro_nonmatching=p.parse_opt(