propex.cxx 1 KB
Newer Older
1 2 3 4 5 6 7 8 9
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

10
#include <sal/main.h>
11

12 13
#include <common.hxx>
#include <propmerge.hxx>
14 15 16

SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
{
Zolnai Tamás's avatar
Zolnai Tamás committed
17 18
    common::HandledArgs aArgs;
    if( !common::handleArguments(argc, argv, aArgs) )
19
    {
Zolnai Tamás's avatar
Zolnai Tamás committed
20
        common::writeUsage("propex","*.properties");
21 22 23
        return 1;
    }

Zolnai Tamás's avatar
Zolnai Tamás committed
24
    PropParser aParser(
25
        aArgs.m_sInputFile, aArgs.m_sLanguage, aArgs.m_bMergeMode );
Zolnai Tamás's avatar
Zolnai Tamás committed
26
    if( !aParser.isInitialized() )
27
    {
Zolnai Tamás's avatar
Zolnai Tamás committed
28 29 30 31
        return 1;
    }
    if( aArgs.m_bMergeMode )
    {
32
        aParser.Merge( aArgs.m_sMergeSrc, aArgs.m_sOutputFile );
Zolnai Tamás's avatar
Zolnai Tamás committed
33 34 35
    }
    else
    {
36
        aParser.Extract( aArgs.m_sOutputFile );
37 38 39 40 41
    }
    return 0;
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */