ref: 4ca9f45db702fe7104ef1c4d0a381f9fa9292f8f
parent: 145e752266fbbc1a5ad039c35ecd2e84753278ae
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Sat Nov 21 16:14:32 EST 2020
Fix tools/free_space.py
--- a/tools/free_space.py
+++ b/tools/free_space.py
@@ -19,13 +19,11 @@
print_bank = 'none'
mapfile = 'pokecrystal.map'
- if len(sys.argv) >= 2 and sys.argv[1].startswith('BANK='):
- print_bank = sys.argv[1].split('=', 1)[-1]
- if len(sys.argv) >= 3:
- mapfile = sys.argv[2]
- elif len(sys.argv) >= 3 and sys.argv[2].startswith('BANK='):
- print_bank = sys.argv[2].split('=', 1)[-1]
- mapfile = sys.argv[1]
+ for arg in sys.argv[1:]:
+ if arg.startswith('BANK='):
+ print_bank = arg.split('=', 1)[-1]
+ else:
+ mapfile = arg
if print_bank not in {'all', 'none'}:
try: