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:
parent
709c2b2d36
commit
c6f4ba77bb
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue