contrib/mbox-split: abort after usage if wrong number of args

Previously, attempting to run the script without args will print:

$ ./mbox-split
Usage: ./mbox-split <input.mbox> <max size with SI suffix>
Traceback (most recent call last):
  File "/tmp/./mbox-split", line 25, in <module>
    if sys.argv[2].endswith(suffix):
IndexError: list index out of range
This commit is contained in:
Eli Schwartz 2021-01-09 21:10:33 -05:00 committed by Drew DeVault
parent 709c2b2d36
commit c6f4ba77bb
1 changed files with 1 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import sys
if len(sys.argv) != 3:
print(f"Usage: {sys.argv[0]} <input.mbox> <max size with SI suffix>")
sys.exit(1)
suffixes = {
"KiB": pow(2, 10),