void process_args()

in blingfiretools/fa_ts2stat/fa_ts2stat.cpp [184:319]


void process_args (int& argc, char**& argv)
{
  for (; argc--; ++argv){

    if (!strcmp ("--help", *argv)) {
        usage ();
        exit (0);
    }
    if (0 == strncmp ("--tagset=", *argv, 9)) {
        g_pTagsetFile = &((*argv) [9]);
        continue;
    }
    if (0 == strcmp ("--ignore-case", *argv)) {
        g_ignore_case = true;
        continue;
    }
    if (0 == strncmp ("--bos-tag=", *argv, 10)) {
        g_pBosTagName = &((*argv) [10]);
        continue;
    }
    if (0 == strncmp ("--eos-tag=", *argv, 10)) {
        g_pEosTagName = &((*argv) [10]);
        continue;
    }
    if (0 == strncmp ("--bos-word=", *argv, 11)) {
        BosWordLen = \
          ::FAStrUtf8ToArray (&((*argv) [11]), BosWord, FALimits::MaxWordLen);
        FAAssert (0 < BosWordLen, FAMsg::InvalidParameters);
        continue;
    }
    if (0 == strncmp ("--eos-word=", *argv, 11)) {
        EosWordLen = \
          ::FAStrUtf8ToArray (&((*argv) [11]), EosWord, FALimits::MaxWordLen);
        FAAssert (0 < EosWordLen, FAMsg::InvalidParameters);
        continue;
    }
    if (0 == strncmp ("--in=", *argv, 5)) {
        g_pInFile = &((*argv) [5]);
        continue;
    }
    if (0 == strncmp ("--out-w=", *argv, 8)) {
        g_pOutFile_w = &((*argv) [8]);
        g_StatMask |= FAFsmConst::STAT_TYPE_W;
        continue;
    }
    if (0 == strncmp ("--out-ww=", *argv, 9)) {
        g_pOutFile_ww = &((*argv) [9]);
        g_StatMask |= FAFsmConst::STAT_TYPE_WW;
        continue;
    }
    if (0 == strncmp ("--out-www=", *argv, 10)) {
        g_pOutFile_www = &((*argv) [10]);
        g_StatMask |= FAFsmConst::STAT_TYPE_WWW;
        continue;
    }
    if (0 == strncmp ("--out-wt=", *argv, 9)) {
        g_pOutFile_wt = &((*argv) [9]);
        g_StatMask |= FAFsmConst::STAT_TYPE_WT;
        continue;
    }
    if (0 == strncmp ("--out-wtt=", *argv, 10)) {
        g_pOutFile_wtt = &((*argv) [10]);
        g_StatMask |= FAFsmConst::STAT_TYPE_WTT;
        continue;
    }
    if (0 == strncmp ("--out-twt=", *argv, 10)) {
        g_pOutFile_twt = &((*argv) [10]);
        g_StatMask |= FAFsmConst::STAT_TYPE_TWT;
        continue;
    }
    if (0 == strncmp ("--out-wtwt=", *argv, 11)) {
        g_pOutFile_wtwt = &((*argv) [11]);
        g_StatMask |= FAFsmConst::STAT_TYPE_WTWT;
        continue;
    }
    if (0 == strncmp ("--out-t=", *argv, 8)) {
        g_pOutFile_t = &((*argv) [8]);
        g_StatMask |= FAFsmConst::STAT_TYPE_T;
        continue;
    }
    if (0 == strncmp ("--out-tt=", *argv, 9)) {
        g_pOutFile_tt = &((*argv) [9]);
        g_StatMask |= FAFsmConst::STAT_TYPE_TT;
        continue;
    }
    if (0 == strncmp ("--out-ttt=", *argv, 10)) {
        g_pOutFile_ttt = &((*argv) [10]);
        g_StatMask |= FAFsmConst::STAT_TYPE_TTT;
        continue;
    }
    if (0 == strncmp ("--out-tttt=", *argv, 11)) {
        g_pOutFile_tttt = &((*argv) [11]);
        g_StatMask |= FAFsmConst::STAT_TYPE_TTTT;
        continue;
    }
    if (0 == strncmp ("--line-step=", *argv, 12)) {
        g_line_step = atoi (&((*argv) [12]));
        continue;
    }
    if (0 == strncmp ("--min-freq=", *argv, 11)) {
        g_min_freq = atoi (&((*argv) [11]));
        continue;
    }
    if (!strcmp ("--print-text", *argv)) {
        g_print_text = true;
        continue;
    }
    if (!strcmp ("--print-input", *argv)) {
        g_print_input = true;
        continue;
    }
    if (!strcmp ("--base=hex", *argv)) {
        g_hex = true;
        g_digits = 4;
        continue;
    }
    if (!strcmp ("--verbose", *argv)) {
        g_verbose = true;
        continue;
    }
    if (0 == strncmp ("--out-w_t=", *argv, 10)) {
        g_pOutFile_w_t = &((*argv) [10]);
        g_StatMask |= FAFsmConst::STAT_TYPE_W_T;
        continue;
    }
    if (0 == strncmp ("--out-tw=", *argv, 9)) {
        g_pOutFile_tw = &((*argv) [9]);
        g_StatMask |= FAFsmConst::STAT_TYPE_TW;
        continue;
    }
    if (!strcmp ("--force", *argv)) {
        g_force = true;
        continue;
    }
  }
}