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 "stringmerge.hxx"
15 :
16 0 : void WriteUsage()
17 : {
18 : std::cout
19 0 : << "Syntax: stringex [-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 : << " FileIn: Source files (strings.xml)\n"
24 0 : << " FileOut: Destination file (*.*)\n"
25 0 : << " DataBase: Mergedata (*.po)\n"
26 0 : << " -l: Restrict the handled languages; l1, l2, ... are elements of"
27 0 : << " (de, en-US, ...)\n";
28 0 : }
29 :
30 :
31 0 : SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
32 : {
33 0 : HandledArgs aArgs;
34 0 : if( !Export::handleArguments(argc, argv, aArgs) )
35 : {
36 0 : WriteUsage();
37 0 : return 1;
38 : }
39 :
40 0 : StringParser aParser(aArgs.m_sInputFile, Export::sLanguages);
41 0 : if( !aParser.isInitialized() )
42 : {
43 0 : return 1;
44 : }
45 :
46 0 : if( aArgs.m_bMergeMode || aArgs.m_sPrj.isEmpty() )
47 : {
48 : aParser.Merge(
49 0 : aArgs.m_sMergeSrc, aArgs.m_sOutputFile );
50 : }
51 : else
52 : {
53 : aParser.Extract(
54 0 : aArgs.m_sOutputFile, aArgs.m_sPrj, aArgs.m_sPrjRoot );
55 : }
56 0 : return 0;
57 0 : }
58 :
59 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|