Explorar o código

partition_table: Fix parttool.py crashes when retrieving partition info

Closes: IDFGH-3279
Closes: https://github.com/espressif/esp-idf/issues/5271
KonstantinKondrashov %!s(int64=5) %!d(string=hai) anos
pai
achega
7070fea6e4
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      components/partition_table/parttool.py

+ 2 - 1
components/partition_table/parttool.py

@@ -261,7 +261,8 @@ def main():
     subparsers.add_parser("erase_partition", help="erase the contents of a partition on the device", parents=[partition_selection_parser])
 
     print_partition_info_subparser = subparsers.add_parser("get_partition_info", help="get partition information", parents=[partition_selection_parser])
-    print_partition_info_subparser.add_argument("--info", help="type of partition information to get", nargs="+")
+    print_partition_info_subparser.add_argument("--info", help="type of partition information to get",
+                                                choices=["offset", "size"], default=["offset", "size"], nargs="+")
 
     args = parser.parse_args()
     quiet = args.quiet