Ignore:
Timestamp:
May 3, 2016, 5:53:12 PM (3 years ago)
Author:
xuedongx
Message:

If '-c', ignore the scanmatch kernel.

File:
1 edited

Legend:

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

    r5017 r5025  
    3232                                      "These options control the output.");
    3333
    34 static cl::opt<bool> CountOnly("c", cl::desc("Count and display the matching lines per file only."), cl::cat(bGrepOutputOptions));
    35 static cl::alias CountOnlyLong("count", cl::desc("Alias for -c"), cl::aliasopt(CountOnly));
    3634static cl::opt<bool> NormalizeLineBreaks("normalize-line-breaks", cl::desc("Normalize line breaks to std::endl."), cl::init(false),  cl::cat(bGrepOutputOptions));
    3735
     
    150148        int idx = fileIdx;
    151149
    152         if(CountOnly){
    153             total_count[idx]++;
    154             return;
    155         }
    156 
    157150        if (ShowFileNames) {
    158151            resultStrs[idx] << inputFiles[idx] << ':';
     
    200193}
    201194
    202 void PrintResult(){
     195void PrintResult(bool CountOnly, std::vector<int> & total_CountOnly){
    203196    if(CountOnly){
    204197        if (!ShowFileNames) {
    205198           for (int i=0; i<inputFiles.size(); i++){
    206                std::cout << total_count[i] << std::endl;
     199               std::cout << total_CountOnly[i] << std::endl;
    207200           }
    208201        }
    209202        else {
    210203            for (int i=0; i<inputFiles.size(); i++){
    211                 std::cout << inputFiles[i] << ':' << total_count[i] << std::endl;
     204                std::cout << inputFiles[i] << ':' << total_CountOnly[i] << std::endl;
    212205            };
    213206        }
Note: See TracChangeset for help on using the changeset viewer.