Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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 : */
9 :
10 : #include <iostream>
11 : #include "sal/main.h"
12 :
13 : #include "export.hxx"
14 : #include "treemerge.hxx"
15 :
16 0 : void WriteUsage()
17 : {
18 : std::cout
19 0 : << "Syntax: Treex [-p Prj] [-r Root] -i FileIn -o FileOut"
20 0 : << " [-m DataBase] [-l l1,l2,...]\n"
21 0 : << " Prj: Project\n"
22 0 : << " Root: Path to project root (../.. etc.)\n"
23 0 : << " or path to root of localized xhp files\n"
24 0 : << " FileIn: Source files (*.tree)\n"
25 0 : << " FileOut: Destination file (*.*)\n"
26 0 : << " DataBase: Mergedata (*.po)\n"
27 0 : << " -l: Restrict the handled languages; l1, l2, ... are elements of"
28 0 : << " (de, en-US, ...)\n";
29 0 : }
30 :
31 :
32 0 : SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
33 : {
34 0 : HandledArgs aArgs;
35 0 : if( !Export::handleArguments(argc, argv, aArgs) )
36 : {
37 0 : WriteUsage();
38 0 : return 1;
39 : }
40 :
41 0 : TreeParser aParser(aArgs.m_sInputFile, Export::sLanguages);
42 0 : if( !aParser.isInitialized() )
43 : {
44 0 : return 1;
45 : }
46 :
47 0 : if( aArgs.m_bMergeMode || aArgs.m_sPrj.isEmpty() )
48 : {
49 : aParser.Merge(
50 0 : aArgs.m_sMergeSrc, aArgs.m_sOutputFile, aArgs.m_sPrjRoot );
51 : }
52 : else
53 : {
54 : aParser.Extract(
55 0 : aArgs.m_sOutputFile, aArgs.m_sPrj, aArgs.m_sPrjRoot );
56 : }
57 0 : return 0;
58 0 : }
59 :
60 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|