in blingfiretools/fa_line2chain_unicode/fa_line2chain_unicode.cpp [255:392]
void process_args (int& argc, char**& argv)
{
for (; argc--; ++argv) {
if (0 == strcmp ("--help", *argv)) {
usage ();
exit (0);
}
if (0 == strncmp ("--out-key2f=", *argv, 12)) {
pKey2FreqFile = &((*argv) [12]);
continue;
}
if (0 == strcmp ("--no-output", *argv)) {
g_no_output = true;
continue;
}
if (0 == strncmp ("--input-enc=", *argv, 12)) {
g_pInEnc = &((*argv) [12]);
g_fDecEnc = (0 == strcmp ("DEC", g_pInEnc));
g_fHexEnc = (0 == strcmp ("HEX", g_pInEnc));
g_fUInt8Enc = (0 == strcmp ("UInt8", g_pInEnc));
continue;
}
if (0 == strncmp ("--base=16", *argv, 9)) {
g_hex_output = true;
continue;
}
if (0 == strncmp ("--dir=l2r", *argv, 9)) {
g_dir = FAFsmConst::DIR_L2R;
continue;
}
if (0 == strncmp ("--dir=r2l", *argv, 9)) {
g_dir = FAFsmConst::DIR_R2L;
continue;
}
if (0 == strncmp ("--dir=aff", *argv, 9)) {
g_dir = FAFsmConst::DIR_AFF;
continue;
}
if (0 == strcmp ("--use-keys", *argv)) {
g_use_keys = true;
continue;
}
if (0 == strcmp ("--use-keypairs", *argv)) {
g_use_keypairs = true;
continue;
}
if (0 == strncmp ("--key-base=", *argv, 11)) {
g_key_base = atoi (&((*argv) [11]));
continue;
}
if (0 == strcmp ("--key-delim", *argv)) {
g_key_delim = true;
continue;
}
if (0 == strcmp ("--float-nums", *argv)) {
g_float_nums = true;
continue;
}
if (0 == strncmp ("--trim=", *argv, 7)) {
g_chain_size_limit = atoi (&((*argv) [7]));
continue;
}
if (0 == strncmp ("--num-size=", *argv, 11)) {
g_num_size = atoi (&((*argv) [11]));
continue;
}
if (0 == strncmp ("--tagset=", *argv, 9)) {
pInTagSetFile = &((*argv) [9]);
g_use_tags = true;
continue;
}
if (0 == strcmp ("--ignore-case", *argv)) {
g_ignore_case = true;
continue;
}
if (0 == strcmp ("--compounds", *argv)) {
g_compounds = true;
continue;
}
if (0 == strncmp ("--redup-delim=", *argv, 14)) {
g_redup_delim = atoi (&((*argv) [14]));
continue;
}
if (0 == strncmp ("--pref-fsm=", *argv, 11)) {
g_pInPrefFsmFile = &((*argv) [11]);
continue;
}
if (0 == strncmp ("--pref-delim=", *argv, 13)) {
g_pref_delim = atoi (&((*argv) [13]));
continue;
}
if (0 == strncmp ("--ucf-delim=", *argv, 12)) {
g_ucf_delim = atoi (&((*argv) [12]));
continue;
}
if (0 == strcmp ("--in-tr=hyph-redup", *argv)) {
g_pInTr = &g_tr_hyph_redup;
continue;
}
if (0 == strcmp ("--in-tr=hyph-redup-rev", *argv)) {
g_pInTr = &g_tr_hyph_redup_rev;
continue;
}
if (0 == strcmp ("--in-tr=pref", *argv)) {
g_pInTr = &g_tr_pref;
continue;
}
if (0 == strcmp ("--in-tr=pref-rev", *argv)) {
g_pInTr = &g_tr_pref_rev;
continue;
}
if (0 == strcmp ("--in-tr=ucf", *argv)) {
g_pInTr = &g_tr_ucf;
continue;
}
if (0 == strcmp ("--in-tr=ucf-rev", *argv)) {
g_pInTr = &g_tr_ucf_rev;
continue;
}
if (0 == strcmp ("--in-tr=unesc", *argv)) {
g_pInTr = &g_tr_unesc;
g_use_tr_unesc = true;
continue;
}
if (0 == strncmp ("--charmap=", *argv, 10)) {
g_pCharMapFile = &((*argv) [10]);
continue;
}
if (0 == strncmp ("--in-tr=", *argv, 8)) {
const char * pTrsStr = &((*argv) [8]);
const int TrsStrLen = (int) strlen (pTrsStr);
InitTrCascade (&g_in_tr_cascade, pTrsStr, TrsStrLen);
g_pInTr = &g_in_tr_cascade;
continue;
}
}
}