summaryrefslogtreecommitdiff
path: root/l10ntools/source/treex.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'l10ntools/source/treex.cxx')
-rw-r--r--l10ntools/source/treex.cxx55
1 files changed, 34 insertions, 21 deletions
diff --git a/l10ntools/source/treex.cxx b/l10ntools/source/treex.cxx
index d8565f8e664a..51874808b71e 100644
--- a/l10ntools/source/treex.cxx
+++ b/l10ntools/source/treex.cxx
@@ -8,6 +8,7 @@
*/
#include <iostream>
+#include <cstring>
#include "sal/main.h"
#include "export.hxx"
@@ -16,21 +17,34 @@
void WriteUsage()
{
std::cout
- << "Syntax: Treex [-p Prj] [-r Root] -i FileIn -o FileOut"
- << " [-m DataBase] [-l l1,l2,...]\n"
- << " Prj: Project\n"
- << " Root: Path to project root (../.. etc.)\n"
- << " or path to root of localized xhp files\n"
+ << "Syntax: Treex [-r Root] -i FileIn -o FileOut"
+ << " [-m DataBase] [-l Lang]\n"
+ << " Root: Path to root of localized xhp files\n"
<< " FileIn: Source files (*.tree)\n"
<< " FileOut: Destination file (*.*)\n"
<< " DataBase: Mergedata (*.po)\n"
- << " -l: Restrict the handled languages; l1, l2, ... are elements of"
- << " (de, en-US, ...)\n";
+ << " Lang: Restrict the handled languages; one element of\n"
+ << " (de, en-US, ...) or all\n";
}
SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
{
+ OString sXHPRoot;
+ for (int nIndex = 1; nIndex != argc; ++nIndex)
+ {
+ if (std::strcmp(argv[nIndex], "-r") == 0)
+ {
+ sXHPRoot = OString( argv[nIndex + 1] );
+ for( int nIndex2 = nIndex+3; nIndex2 < argc; nIndex2 = nIndex2 + 2 )
+ {
+ argv[nIndex-3] = argv[nIndex-1];
+ argv[nIndex-2] = argv[nIndex];
+ }
+ argc = argc - 2;
+ break;
+ }
+ }
HandledArgs aArgs;
if( !Export::handleArguments(argc, argv, aArgs) )
{
@@ -38,21 +52,20 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
return 1;
}
- TreeParser aParser(aArgs.m_sInputFile, Export::sLanguages);
- if( !aParser.isInitialized() )
- {
- return 1;
- }
+ TreeParser aParser(aArgs.m_sInputFile, aArgs.m_sLanguage );
+ if( !aParser.isInitialized() )
+ {
+ return 1;
+ }
- if( aArgs.m_bMergeMode || aArgs.m_sPrj.isEmpty() )
- {
- aParser.Merge(
- aArgs.m_sMergeSrc, aArgs.m_sOutputFile, aArgs.m_sPrjRoot );
- }
- else
- {
- aParser.Extract( aArgs.m_sOutputFile );
- }
+ if( aArgs.m_bMergeMode || !sXHPRoot.isEmpty() )
+ {
+ aParser.Merge( aArgs.m_sMergeSrc, aArgs.m_sOutputFile, sXHPRoot );
+ }
+ else
+ {
+ aParser.Extract( aArgs.m_sOutputFile );
+ }
return 0;
}