diff --git a/unqar.py b/unqar.py index 50637c9..aefbf7d 100755 --- a/unqar.py +++ b/unqar.py @@ -31,12 +31,17 @@ def __del__(self): self.file.close() -if len(sys.argv) < 2: +def print_usage(): print("Usage: %s []" % sys.argv[0]) + + +if len(sys.argv) < 2: + print_usage() exit(1) binaryReader = BinaryReader(sys.argv[1]) output_path = pathlib.Path.cwd() + if len(sys.argv) > 2: output_path = str(sys.argv[2]) @@ -44,7 +49,7 @@ def __del__(self): magic = binaryReader.unpack('" % sys.argv[0]) + print_usage() exit(2) file_count = binaryReader.unpack('