diff --git a/components/partition_table/gen_esp32part.py b/components/partition_table/gen_esp32part.py index 97e63ccf4b1..ade202fc1c1 100755 --- a/components/partition_table/gen_esp32part.py +++ b/components/partition_table/gen_esp32part.py @@ -20,6 +20,7 @@ import struct import sys import rich_click as click +from esp_pylib.cli_options import OptionEatAll from esp_pylib.cli_types import AnyIntType from esp_pylib.logger import log @@ -793,7 +794,16 @@ def run_gen( default=None, help='Require app partitions to be suitable for secure boot', ) -@click.option('--extra-partition-subtypes', multiple=True, help='Extra partition subtype entries') +# Use OptionEatAll to keep argparse nargs='*' semantics: a single +# --extra-partition-subtypes flag consumes all following space-separated +# entries (CMake partition_table/CMakeLists.txt passes them this way). +@click.option( + '--extra-partition-subtypes', + multiple=True, + cls=OptionEatAll, + type=str, + help='Extra partition subtype entries', +) @click.argument('input_file', type=click.File('rb'), metavar='INPUT') @click.argument('output', type=click.Path(), required=False, default='-') def cli( diff --git a/components/partition_table/parttool.py b/components/partition_table/parttool.py index adf98a632b1..55a2f7ce7c5 100755 --- a/components/partition_table/parttool.py +++ b/components/partition_table/parttool.py @@ -270,7 +270,16 @@ def _partition_selection_options(func): help='select the default boot partition using the same fallback logic as the IDF bootloader', ), click.option('--partition-subtype', '-s', help='subtype of the partition'), - click.option('--extra-partition-subtypes', multiple=True, help='Extra partition subtype entries'), + # Use OptionEatAll to keep argparse nargs='*' semantics: a single + # --extra-partition-subtypes flag consumes all following space-separated + # entries (CMake project_include.cmake passes them this way). + click.option( + '--extra-partition-subtypes', + multiple=True, + cls=OptionEatAll, + type=str, + help='Extra partition subtype entries', + ), ] for decorator in reversed(decorators): func = decorator(func)