1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
15 #include <treemerge.hxx>
17 static void WriteUsage()
20 << ("Syntax: Treex [-r Root] -i FileIn -o FileOut"
21 " [-m DataBase] [-l Lang]\n"
22 " Root: Path to root of localized xhp files\n"
23 " FileIn: Source files (*.tree)\n"
24 " FileOut: Destination file (*.*)\n"
25 " DataBase: Mergedata (*.po)\n"
26 " Lang: Restrict the handled languages; one element of\n"
27 " (de, en-US, ...) or all\n");
31 SAL_IMPLEMENT_MAIN_WITH_ARGS(argc
, argv
)
34 for (int nIndex
= 1; nIndex
!= argc
; ++nIndex
)
36 if (std::strcmp(argv
[nIndex
], "-r") == 0)
38 sXHPRoot
= OString( argv
[nIndex
+ 1] );
39 for( int nIndex2
= nIndex
+3; nIndex2
< argc
; nIndex2
= nIndex2
+ 2 )
41 argv
[nIndex
-3] = argv
[nIndex
-1];
42 argv
[nIndex
-2] = argv
[nIndex
];
48 common::HandledArgs aArgs
;
49 if( !common::handleArguments(argc
, argv
, aArgs
) )
55 TreeParser
aParser(aArgs
.m_sInputFile
, aArgs
.m_sLanguage
);
56 if( !aParser
.isInitialized() )
61 if( aArgs
.m_bMergeMode
|| !sXHPRoot
.isEmpty() )
63 aParser
.Merge( aArgs
.m_sMergeSrc
, aArgs
.m_sOutputFile
, sXHPRoot
);
67 aParser
.Extract( aArgs
.m_sOutputFile
);
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */