defer finding dialog parent until we need it
[LibreOffice.git] / codemaker / source / netmaker / netmaker.cxx
blob5995a115bfc9f55ebbd83ec690e22e76ff10f683
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <iostream>
12 #include <sal/main.h>
13 #include <unoidl/unoidl.hxx>
15 #include "netoptions.hxx"
16 #include "netproduce.hxx"
18 // coverity[tainted_data] - this is a build time tool
19 SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
21 try
23 NetOptions options;
24 NetProducer producer;
26 if (options.initOptions(argc, argv))
28 producer.initProducer(options);
29 producer.produceAll();
32 catch (const ::IllegalArgument& e)
34 std::cerr << "ERROR: Illegal option " << e.m_message << '\n';
35 return EXIT_FAILURE;
37 catch (const ::CannotDumpException& e)
39 std::cerr << "ERROR: Could not dump as " << e.getMessage() << '\n';
40 return EXIT_FAILURE;
42 catch (const unoidl::NoSuchFileException& e)
44 std::cerr << "ERROR: No such file " << e.getUri() << '\n';
45 return EXIT_FAILURE;
47 catch (const unoidl::FileFormatException& e)
49 std::cerr << "ERROR: Bad format of " << e.getUri() << ", '" << e.getDetail() << "'\n";
50 return EXIT_FAILURE;
52 catch (const std::exception& e)
54 std::cerr << "ERROR: " << e.what() << '\n';
55 return EXIT_FAILURE;
58 return EXIT_SUCCESS;
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */