From c6f4ba77bbf21f3d4969b04f7188c8bc71c993ac Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sat, 9 Jan 2021 21:10:33 -0500 Subject: [PATCH] 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 Traceback (most recent call last): File "/tmp/./mbox-split", line 25, in if sys.argv[2].endswith(suffix): IndexError: list index out of range --- contrib/mbox-split | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/mbox-split b/contrib/mbox-split index 89c1530..7215d79 100755 --- a/contrib/mbox-split +++ b/contrib/mbox-split @@ -10,6 +10,7 @@ import sys if len(sys.argv) != 3: print(f"Usage: {sys.argv[0]} ") + sys.exit(1) suffixes = { "KiB": pow(2, 10),