Пример #1
0
void IndexMergerAppRunner::optionCallback(const Option& option, const tstring& sValue)
{
    if (option.matchFull(_T("merge-index")) || option.matchShort(_T("m")))
    {
        if (sValue.empty() || (!sValue.compare(_T("merge"))))
        {
            m_nMergeMode = 1;
        }
        else if (!sValue.compare(_T("optimize")))
        {
            m_nMergeMode = 2;
        }
        else 
        {
            throw UnknownOptionException(sValue);
        }
    }
    else if (option.matchFull(_T("index-path")) || option.matchShort(_T("i")))
    {
        if (sValue.empty())
        {
            throw MissingArgumentException("--index-path/-i");
        }
        m_sIndexPath = sValue;
    }
    else if (option.matchFull(_T("lexicon-dir")) || option.matchShort(_T("l")))
    {
        if (sValue.empty())
        {
            throw MissingArgumentException("--def-field/-d");
        }
        m_sLexiDir = sValue;
    }
}
Пример #2
0
void SearchServerAppRunner::optionCallback(const Option& option,
        const tstring& sValue)
{
    if (option.matchFull("conf") || option.matchShort("c"))
    {
        if (sValue.empty())
        {
            throw MissingArgumentException("--conf/-c");
        }
        m_sConfFile = sValue;
    }
    if (option.matchFull("service-type") || option.matchShort("t"))
    {
        if (sValue.empty())
        {
            throw MissingArgumentException("--service-type/-t");
        }

        if (sValue != "rpc" && sValue != "http")
        {
            FIRTEX_THROW(BadParameterException, "the value of --service-type "
                         "must be rpc or http");
        }
        m_sServiceType = sValue;
    }
}
Пример #3
0
void BuilderAppRunner::optionCallback(const Option& option,
        const std::string& sValue)
{
    if (option.matchFull("config") || option.matchShort("c"))
    {
        if (sValue.empty())
        {
            FIRTEX_THROW(MissingArgumentException, "--config/-c");
        }
        m_sConfFile = sValue;
    }

    if (option.matchFull("monitor") || option.matchShort("m"))
    {
        m_bMonitor = true;
    }
}
Пример #4
0
void IndexBuilderAppRunner::optionCallback(const Option& option, const tstring& sValue)
{
    if (option.matchFull(_T("build-index")) || option.matchShort(_T("b")))
    {
        if (sValue.empty())
        {
            FIRTEX_THROW(MissingArgumentException, "--build-index/-b");
        }
        m_sConfFile = sValue;
    }
}
Пример #5
0
void LexiconBuilderAppRunner::optionCallback(const Option& option, const tstring& sValue)
{
    if (option.matchFull(_T("source-file")) || option.matchShort(_T("s")))
    {
        if (sValue.empty())
        {
            throw MissingArgumentException("--source-file/-s");
        }
        m_sSourceFile = sValue;
    }

    if (option.matchFull(_T("target-file")) || option.matchShort(_T("t")))
    {
        if (sValue.empty())
        {
            throw MissingArgumentException("--target-file/-t");
        }
        m_sTargetFile = sValue;
    }
}