diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-11-21 21:14:30 -0500 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-11-21 21:14:30 -0500 |
commit | b4c5ade8b38670ae342ce30f5811e9be5429161a (patch) | |
tree | 86d9aa4aba397e1d82856299b2f13c74e56fac7e /tools/free_space.py | |
parent | 653e92d803ca8c8022cf33df1dc47dbd33e105af (diff) |
Fix tools/free_space.py
Diffstat (limited to 'tools/free_space.py')
-rw-r--r-- | tools/free_space.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tools/free_space.py b/tools/free_space.py index d6af522f..c775ad93 100644 --- a/tools/free_space.py +++ b/tools/free_space.py @@ -19,13 +19,11 @@ def main(): print_bank = 'none' mapfile = 'pokegold.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: |