#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from tinyscript import *

from reccomp import Decompressor
from reccomp.__info__ import *


__training__ = "ZSIS CTF - Trivia - Shining (4 points)"
__examples__ = ["archive.zip", "archive.zip -d"]
__doc__ = """
This tool allows to recursively decompress an archive relying on Patool, a
 Python library supporting various archive formats.

Note: Password-protected compression is not supported yet. If the tool freezes
       while decompressing, it may be necessary to press enter to submit a blank
       password, which will stop decompression.
"""


if __name__ == '__main__':
    parser.add_argument("archive", help="input archive")
    parser.add_argument("-d", dest="delete", action="store_true",
                        help="delete input archive")
    parser.add_argument("-p", dest="printf", action="store_true",
                        help="print resulting file, if possible")
    initialize(add_time=True)
    Decompressor(logger=logger, **vars(args))
