#define XERR
#include "main.ih"

int main(int argc, char **argv)
try
{
    if (argc == 1)
    {
        cout << 
            "provide the name of the directory containing the .zip's CONTENT\n";
        return 1;
    }

    fs::current_path(argv[1]);                // go to the target dir

    ZipCheck zipCheck;

    if (not zipCheck.inspect(argv[1]))
        cout << "inspect returns:\n" << 
                zipCheck.error() << '\n';
    else
    {
        for (auto const &mapValue: zipCheck.orderTxtMap())
        {
            for (auto const &element: mapValue.second)
                xerr(element.name);
        }
    }
}
catch (exception const &exc)
{
    cerr << exc.what() << '\n';
}
catch (...)
{
    cerr << "unexpected exception\n";
    return 1;
}
