Ignore:
Timestamp:
Jan 8, 2015, 8:41:34 AM (4 years ago)
Author:
cameron
Message:

Command line parameter -i for case-insensitive matching

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/icgrep.cpp

    r4401 r4412  
    6060    cl::alias ShowFileNamesLong("with-filename", cl::desc("Alias for -H"), cl::aliasopt(ShowFileNames));
    6161   
     62    cl::opt<bool> CaseInsensitive("i", cl::desc("Ignore case distinctions in the pattern and the file."), cl::cat(aRegexSourceOptions));
    6263    cl::opt<bool> ShowLineNumbers("n", cl::desc("Show the line number with each matching line."), cl::cat(bGrepOutputOptions));
    6364    cl::alias ShowLineNumbersLong("line-number", cl::desc("Alias for -n"), cl::aliasopt(ShowLineNumbers));
     
    9899    }
    99100   
    100     const auto llvm_codegen = icgrep::compile(encoding, regexVector, false);
     101    re::ModeFlagSet globalFlags = 0;
     102    if (CaseInsensitive) globalFlags |= re::CASE_INSENSITIVE_MODE_FLAG;
     103   
     104    const auto llvm_codegen = icgrep::compile(encoding, regexVector, globalFlags);
    101105
    102106    if (llvm_codegen.process_block_fptr != 0) {
Note: See TracChangeset for help on using the changeset viewer.