Ignore:
Timestamp:
Dec 8, 2014, 4:29:09 PM (5 years ago)
Author:
cameron
Message:

Line numbering option

File:
1 edited

Legend:

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

    r4325 r4327  
    44 *  icgrep is a trademark of International Characters.
    55 */
     6
     7#include <string>
    68
    79#include "icgrep.h"
     
    1113#include "do_grep.h"
    1214
    13 #include <fstream>
    14 #include <sstream>
    15 #include <iostream>
    16 #include <string>
    17 #include <stdint.h>
    18 
    19 #include <stdio.h>
    20 #include <stdlib.h>
    21 #include <unistd.h>
    22 #include <errno.h>
    23 #include <sys/types.h>
    24 #include <sys/stat.h>
    25 
    2615#include "llvm/Support/CommandLine.h"
    2716
    28 
    29    
    3017int main(int argc, char *argv[]) {
    3118    static cl::opt<std::string> regexp1(cl::Positional, cl::Required, cl::desc("<regexp>"));
     
    5340    const auto llvm_codegen = icgrep::compile(encoding, regexp1, false, false);
    5441
    55     if (llvm_codegen.process_block_fptr != 0)
    56      
    57     {
     42    if (llvm_codegen.process_block_fptr != 0) {
    5843        void (*FP)(const Basis_bits &basis_bits, BitBlock carry_q[], BitBlock advance_q[], Output &output) =
    5944           (void (*)(const Basis_bits &basis_bits, BitBlock carry_q[], BitBlock advance_q[], Output &output))(void*)llvm_codegen.process_block_fptr;
    6045        GrepExecutor grepEngine = GrepExecutor(llvm_codegen.carry_q_size, llvm_codegen.advance_q_size, FP);
    6146        grepEngine.setCountOnlyOption(CountOnly);
    62         if (inputFiles.size() > 1) grepEngine.setShowFileNameOption();
     47        grepEngine.setShowLineNumberOption(ShowLineNumbers);
     48        if (inputFiles.size() > 1 || ShowFileNames) grepEngine.setShowFileNameOption();
    6349        for (unsigned i = 0; i != inputFiles.size(); ++i) {
    6450            grepEngine.doGrep(inputFiles[i].c_str());
    6551        }
    6652    }
    67 
     53   
    6854    return 0;
    6955}
Note: See TracChangeset for help on using the changeset viewer.