summaryrefslogtreecommitdiffstats
path: root/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/main.cc b/main.cc
index 0440f77..f0a66e1 100644
--- a/main.cc
+++ b/main.cc
@@ -251,7 +251,7 @@ int main( const int argc, const char * const argv[] )
int argind = 0;
int grep_show_name = -1;
- bool grep_list = false;
+ int grep_list_mode = 0; // 1 = list matches, -1 = list non matches
bool grep_pattern_found = false;
for( ; argind < parser.arguments(); ++argind )
{
@@ -317,8 +317,8 @@ int main( const int argc, const char * const argv[] )
case 'H': grep_show_name = true; break;
case 'i': grep_args.push_back( "-i" ); break;
case 'I': grep_args.push_back( "-I" ); break;
- case 'l': grep_args.push_back( "-l" ); grep_list = true; break;
- case 'L': grep_args.push_back( "-L" ); grep_list = true; break;
+ case 'l': grep_args.push_back( "-l" ); grep_list_mode = 1; break;
+ case 'L': grep_args.push_back( "-L" ); grep_list_mode = -1; break;
case 'm': grep_args.push_back( "-m" ); grep_args.push_back( arg ); break;
case 'n': grep_args.push_back( "-n" ); break;
case 'o': grep_args.push_back( "-o" ); break;
@@ -412,7 +412,7 @@ int main( const int argc, const char * const argv[] )
if( infd == STDIN_FILENO )
tmp = zgrep_stdin( infd, format_type, grep_args );
else tmp = zgrep_file( infd, format_type, input_filename, grep_args,
- grep_list, grep_show_name );
+ grep_list_mode, grep_show_name );
break;
case m_ztest:
if( infd == STDIN_FILENO )